|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.graph.properties.basic.BasicPathSegment
@Immutable public class BasicPathSegment

A basic implementation of Path.Segment.
| Constructor Summary | |
|---|---|
BasicPathSegment(Name name)
|
|
BasicPathSegment(Name name,
int index)
|
|
| Method Summary | |
|---|---|
int |
compareTo(Path.Segment that)
|
boolean |
equals(Object obj)
|
int |
getIndex()
Get the index for this segment, which will be 0 if this segment has no specific index. |
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. |
int |
hashCode()
|
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. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BasicPathSegment(Name name)
name - the segment name
IllegalArgumentException - if the name is null or if the index is invalid
public BasicPathSegment(Name name,
int index)
name - the segment nameindex - the segment index
IllegalArgumentException - if the name is null or if the index is invalid| Method Detail |
|---|
public int getIndex()
0 if this segment has no specific index.
getIndex in interface Path.Segmentpublic Name getName()
getName in interface Path.Segmentpublic boolean hasIndex()
hasIndex in interface Path.Segmentpublic boolean isParentReference()
isParentReference in interface Path.Segmentpublic boolean isSelfReference()
isSelfReference in interface Path.Segmentpublic int compareTo(Path.Segment that)
compareTo in interface Comparable<Path.Segment>public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Objectpublic String getUnencodedString()
no-op encoder. This is equivalent to
calling getString(Path.NO_OP_ENCODER).
getUnencodedString in interface Path.SegmentPath.Segment.getString(TextEncoder)public String getString()
default encoder is used to encode characters in each
of the path segments.
getString in interface Path.SegmentPath.Segment.getString(TextEncoder)public String getString(TextEncoder encoder)
getString in interface Path.Segmentencoder - the encoder to use, or null if the default encoder should be used
Path.Segment.getString()public String getString(NamespaceRegistry namespaceRegistry)
default encoder is used to encode characters in each of the path segments.
getString in interface Path.SegmentnamespaceRegistry - the namespace registry that should be used to obtain the prefix for the
namespace URI in the segment's name
Path.Segment.getString(NamespaceRegistry,TextEncoder)
public String getString(NamespaceRegistry namespaceRegistry,
TextEncoder encoder)
getString in interface Path.SegmentnamespaceRegistry - the namespace registry that should be used to obtain the prefix for the
namespace URI in the segment's nameencoder - the encoder to use, or null if the default encoder should be used
Path.Segment.getString(NamespaceRegistry)
public String getString(NamespaceRegistry namespaceRegistry,
TextEncoder encoder,
TextEncoder delimiterEncoder)
namespace prefix and the
local part.
getString in interface Path.SegmentnamespaceRegistry - 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 in the segment's name, 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 each segment, or
null if the standard delimiters should be used
Path.Segment.getString(org.jboss.dna.graph.properties.NamespaceRegistry,
org.jboss.dna.common.text.TextEncoder, org.jboss.dna.common.text.TextEncoder)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||