org.apache.woden.xpointer

## Class ElementPointerPart

- java.lang.Object
- - org.apache.woden.xpointer.ElementPointerPart

- All Implemented Interfaces:
    PointerPart

      public class ElementPointerPart
      extends Object
      implements PointerPart

  ElementPointerPart is a class which represents the element() scheme for the XPointer Framework. The specification is defined at http://www.w3.org/TR/xptr-element/ This class is immutable.
  Author:
    Dan Harvey (danharvey42@gmail.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ElementPointerPart(List<Integer> childSequence)` Constructs an ElementPointerPart with only a childSequence.
    `ElementPointerPart(NCName elementID)` Constructs an ElementPointerPart with only an elementID NCName.
    `ElementPointerPart(NCName elementID, List<Integer> childSequence)` Constructs an ElementPointerPart with both an NCName and a childSequence.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Integer[]` | `getChildSequence()` Returns the child sequence of this Element PointerPart.
    `NCName` | `getNCName()` Returns the NCName for this Element PointerPart.
    `boolean` | `hasChildSequence()` Checks if this Element PointerPart has a childSequence or not.
    `boolean` | `hasNCName()` Checks if this Element PointerPart has a NCName or not.
    `static ElementPointerPart` | `parseFromString(String schemeData)` Deserialises the schemaData for an ElementPointerPart and constructs a new ElementPointerPart from it.
    `String` | `toString()` Returns a String serialisation of this xpointer PointerPart.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ElementPointerPart

          public ElementPointerPart(NCName elementID)

      Constructs an ElementPointerPart with only an elementID NCName.
      Parameters:
        `elementID` - an NCName of the elementID to reference.
      Throws:
        `NullPointerException` - is a null elementID is given.

    - #### ElementPointerPart

          public ElementPointerPart(List<Integer> childSequence)

      Constructs an ElementPointerPart with only a childSequence.
      Parameters:
        `childSequence` - a List of Integers representing the child sequence.
      Throws:
        `NullPointerException` - if childSequence is null.
        `IllegalArgumentException` - if childSequence is empty or contains elements other than Integers.

    - #### ElementPointerPart

          public ElementPointerPart(NCName elementID,
                            List<Integer> childSequence)

      Constructs an ElementPointerPart with both an NCName and a childSequence.
      Parameters:
        `elementID` - an NCName of the elementID to reference.
        `childSequence` - a List of Integers representing the child sequence.
      Throws:
        `NullPointerException` - if elementID or childSequence are null.
        `IllegalArgumentException` - if childSequence is empty or contains elements other than Integers.

  - ### Method Detail

    - #### getNCName

          public NCName getNCName()

      Returns the NCName for this Element PointerPart.
      Returns:
        an NCName if it exists in this Element PointerPart, otherwise null.

    - #### getChildSequence

          public Integer[] getChildSequence()

      Returns the child sequence of this Element PointerPart.
      Returns:
        a Integer[] of the child sequence for this element pointer part, or an empty array if none exists.

    - #### hasNCName

          public boolean hasNCName()

      Checks if this Element PointerPart has a NCName or not.
      Returns:
        a boolean, true if it has a NCName or false if not.

    - #### hasChildSequence

          public boolean hasChildSequence()

      Checks if this Element PointerPart has a childSequence or not.
      Returns:
        a boolean, true if this has a childSequence or false if not.

    - #### toString

          public String toString()

      Description copied from interface: `PointerPart`
      Returns a String serialisation of this xpointer PointerPart.
      Specified by:
        `toString` in interface `PointerPart`
      Overrides:
        `toString` in class `Object`
      Returns:
        a String containing the serialisation of this xpointer PointerPart.

    - #### parseFromString

          public static ElementPointerPart parseFromString(String schemeData)
                                                    throws InvalidXPointerException

      Deserialises the schemaData for an ElementPointerPart and constructs a new ElementPointerPart from it.
      Parameters:
        `schemeData` - a String of the schemeaData parsed from the string XPointer.
      Returns:
        an ElementPointerPart representing the parsed schemaData.
      Throws:
        `IllegalArgumentException` - if the schemeData has invalid scheme syntax.
        `InvalidXPointerException`

Copyright ? Apache Software Foundation. All Rights Reserved.