@Immutable public class BasicPathSegment extends Object implements Path.Segment
Path.Segment.| Constructor and Description |
|---|
BasicPathSegment(Name name) |
BasicPathSegment(Name name,
int index) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Path.Segment that) |
boolean |
equals(Object obj) |
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 object.
|
String |
getString(NamespaceRegistry namespaceRegistry)
Get the string form of the object, using the supplied namespace registry to convert any namespace URIs to prefixes.
|
String |
getString(NamespaceRegistry namespaceRegistry,
TextEncoder encoder)
Get the encoded string form of the object, using the supplied namespace registry to convert the any namespace URIs to
prefixes.
|
String |
getString(NamespaceRegistry namespaceRegistry,
TextEncoder encoder,
TextEncoder delimiterEncoder)
Get the encoded string form of the object, using the supplied namespace registry to convert the names' namespace URIs to
prefixes and the supplied encoder to encode characters, and using the second delimiter to encode (or convert) the delimiter
used between the namespace prefix and the local part of any names.
|
String |
getString(TextEncoder encoder)
Get the encoded string form of the object, using the supplied encoder to encode characters.
|
String |
getUnencodedString()
Get the raw string form of the segment using the
no-op encoder. |
int |
hashCode() |
boolean |
hasIndex()
Return whether this segment has an index.
|
boolean |
isIdentifier()
Return whether this segment is an identifier segment.
|
boolean |
isParentReference()
Return whether this segment is a reference to a parent.
|
boolean |
isSelfReference()
Return whether this segment is a self-reference.
|
String |
toString() |
public BasicPathSegment(Name name)
name - the segment nameIllegalArgumentException - if the name is null or if the index is invalidpublic BasicPathSegment(Name name, int index)
name - the segment nameindex - the segment indexIllegalArgumentException - if the name is null or if the index is invalidpublic int getIndex()
Path.SegmentgetIndex in interface Path.Segmentpublic Name getName()
Path.SegmentgetName in interface Path.Segmentpublic boolean hasIndex()
Path.SegmenthasIndex in interface Path.Segmentpublic boolean isParentReference()
Path.SegmentisParentReference in interface Path.Segmentpublic boolean isSelfReference()
Path.SegmentisSelfReference in interface Path.Segmentpublic boolean isIdentifier()
Path.SegmentisIdentifier in interface Path.Segmentpublic int compareTo(Path.Segment that)
compareTo in interface Comparable<Path.Segment>public String getUnencodedString()
Path.Segmentno-op encoder. This is equivalent to
calling getString(Path.NO_OP_ENCODER).getUnencodedString in interface Path.SegmentReadable.getString(TextEncoder)public String getString()
Readabledefault encoder is used to encode characters.getString in interface ReadableReadable.getString(TextEncoder)public String getString(TextEncoder encoder)
ReadablegetString in interface Readableencoder - the encoder to use, or null if the default encoder should be usedReadable.getString()public String getString(NamespaceRegistry namespaceRegistry)
Readabledefault encoder is used to encode characters.getString in interface ReadablenamespaceRegistry - the namespace registry that should be used to obtain the prefix for any namespace URIsReadable.getString(NamespaceRegistry,TextEncoder)public String getString(NamespaceRegistry namespaceRegistry, TextEncoder encoder)
ReadablegetString in interface ReadablenamespaceRegistry - the namespace registry that should be used to obtain the prefix for the namespace URIsencoder - the encoder to use, or null if the default encoder should be usedReadable.getString(NamespaceRegistry)public String getString(NamespaceRegistry namespaceRegistry, TextEncoder encoder, TextEncoder delimiterEncoder)
ReadablegetString in interface ReadablenamespaceRegistry - the namespace registry that should be used to obtain the prefix for the namespace URIs in the
segment namesencoder - the encoder to use for encoding the local part and namespace prefix of any names, or null if the
default encoder should be useddelimiterEncoder - the encoder to use for encoding the delimiter between the local part and namespace prefix of any
names, or null if the standard delimiter should be usedReadable.getString(NamespaceRegistry),
Readable.getString(NamespaceRegistry, TextEncoder)Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.