Enum XPointer

java.lang.Object
java.lang.Enum<XPointer>
org.apache.sis.xml.XPointer
All Implemented Interfaces:
Serializable, Comparable<XPointer>, java.lang.constant.Constable

enum XPointer extends Enum<XPointer>
Parsers of pointers in x-paths, adapted to the syntax found in GML documents.
Since:
1.2
Version:
1.3
  • Enum Constant Details

    • UOM

      public static final XPointer UOM
      Pointer to units of measurement. Example: "http://www.isotc211.org/2005/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])")
  • Field Details

    • documents

      private final String[] documents
      The documents expected at the end of the URL, before the fragment. One of those document should be present.
    • identifier

      private final String identifier
      The text prefixing the identifier.
  • Constructor Details

    • XPointer

      private XPointer(String[] documents, String identifier)
      Creates a new enumeration value.
  • Method Details

    • values

      public static XPointer[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static XPointer valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • startOfFragment

      private int startOfFragment(String url)
      Returns the index where the document fragment starts in the given URL, or -1 if none. For now we accept any path as long as it ends with the "gmxUom.xml" file (for example) because resources may be hosted on different servers, or the path may be relative instead of absolute.
    • reference

      public String reference(String url)
      Parses a URL which contains a pointer to a XML fragment. The current implementation recognizes the following examples:
      • UOM: "http://www.isotc211.org/2005/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])")
      Parameters:
      url - the URL to parse.
      Returns:
      the reference, or null if none.
    • endOfURI

      public static int endOfURI(CharSequence uri, int offset)
      If the given character sequences seems to be a URI, returns the presumed end of that URN. Otherwise returns -1. Examples:
      • "urn:ogc:def:uom:EPSG::9001"
      • "http://www.isotc211.org/2005/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])"
      Parameters:
      uri - the URI candidate to verify.
      offset - index of the first character to verify.
      Returns:
      index after the last character of the presumed URI, or -1 if this method thinks that the given character sequence is not a URI.