org.jboss.dna.graph.property
Interface Path.Segment

All Superinterfaces:
Cloneable, Comparable<Path.Segment>, Serializable
All Known Implementing Classes:
BasicPathSegment
Enclosing interface:
Path

@Immutable
public static interface Path.Segment
extends Cloneable, Comparable<Path.Segment>, Serializable

Representation of the segments that occur within a path.

Author:
Randall Hauch

Method Summary
 int getIndex()
          Get the index for this segment, which will be 1 by default.
 Name getName()
          Get the name component of this segment.
 String getString()
          Get the string form of the segment.
 String getString(NamespaceRegistry namespaceRegistry)
          Get the string form of the segment, using the supplied namespace registry to convert the name's namespace URI to a prefix.
 String getString(NamespaceRegistry namespaceRegistry, TextEncoder encoder)
          Get the encoded string form of the segment, using the supplied namespace registry to convert the name's namespace URI to a prefix and the supplied encoder to encode characters in each of the path segments.
 String getString(NamespaceRegistry namespaceRegistry, TextEncoder encoder, TextEncoder delimiterEncoder)
          Get the encoded string form of the segment, using the supplied namespace registry to convert the names' namespace URIs to prefixes and the supplied encoder to encode characters in each of the path segments.
 String getString(TextEncoder encoder)
          Get the encoded string form of the segment, using the supplied encoder to encode characters in each of the path segments.
 String getUnencodedString()
          Get the raw string form of the segment using the no-op encoder.
 boolean hasIndex()
          Return whether this segment has an index.
 boolean isParentReference()
          Return whether this segment is a reference to a parent.
 boolean isSelfReference()
          Return whether this segment is a self-reference.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getName

Name getName()
Get the name component of this segment.

Returns:
the segment's name

getIndex

int getIndex()
Get the index for this segment, which will be 1 by default.

Returns:
the index

hasIndex

boolean hasIndex()
Return whether this segment has an index.

Returns:
true if this segment has an index, or false otherwise.

isSelfReference

boolean isSelfReference()
Return whether this segment is a self-reference.

Returns:
true if the segment is a self-reference, or false otherwise.

isParentReference

boolean isParentReference()
Return whether this segment is a reference to a parent.

Returns:
true if the segment is a parent-reference, or false otherwise.

getUnencodedString

String getUnencodedString()
Get the raw string form of the segment using the no-op encoder. This is equivalent to calling getString(Path.NO_OP_ENCODER).

Returns:
the un-encoded string
See Also:
getString(TextEncoder)

getString

String getString()
Get the string form of the segment. The default encoder is used to encode characters in each of the path segments.

Returns:
the encoded string
See Also:
getString(TextEncoder)

getString

String getString(TextEncoder encoder)
Get the encoded string form of the segment, using the supplied encoder to encode characters in each of the path segments.

Parameters:
encoder - the encoder to use, or null if the default encoder should be used
Returns:
the encoded string
See Also:
getString()

getString

String getString(NamespaceRegistry namespaceRegistry)
Get the string form of the segment, using the supplied namespace registry to convert the name's namespace URI to a prefix. The default encoder is used to encode characters in each of the path segments.

Parameters:
namespaceRegistry - the namespace registry that should be used to obtain the prefix for the namespace URI in the segment's name
Returns:
the encoded string
Throws:
IllegalArgumentException - if the namespace registry is null
See Also:
getString(NamespaceRegistry,TextEncoder)

getString

String getString(NamespaceRegistry namespaceRegistry,
                 TextEncoder encoder)
Get the encoded string form of the segment, using the supplied namespace registry to convert the name's namespace URI to a prefix and the supplied encoder to encode characters in each of the path segments.

Parameters:
namespaceRegistry - the namespace registry that should be used to obtain the prefix for the namespace URI in the segment's name
encoder - the encoder to use, or null if the default encoder should be used
Returns:
the encoded string
Throws:
IllegalArgumentException - if the namespace registry is null
See Also:
getString(NamespaceRegistry)

getString

String getString(NamespaceRegistry namespaceRegistry,
                 TextEncoder encoder,
                 TextEncoder delimiterEncoder)
Get the encoded string form of the segment, using the supplied namespace registry to convert the names' namespace URIs to prefixes and the supplied encoder to encode characters in each of the path segments. The second encoder is used to encode (or convert) the delimiter between the namespace prefix and the local part.

Parameters:
namespaceRegistry - the namespace registry that should be used to obtain the prefix for the namespace URIs in the segment names
encoder - the encoder to use for encoding the local part and namespace prefix in the segment's name, or null if the default encoder should be used
delimiterEncoder - the encoder to use for encoding the delimiter between the local part and namespace prefix of each segment, or null if the standard delimiters should be used
Returns:
the encoded string
See Also:
getString(NamespaceRegistry), getString(NamespaceRegistry, TextEncoder)


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.