public class XPointer extends Object
Constructor and Description |
---|
XPointer()
Constructs a new XPointer.
|
XPointer(String xpointerString)
Constructs a new XPointer from the serialised string.
|
Modifier and Type | Method and Description |
---|---|
void |
addPointerPart(int index,
PointerPart pointerPart)
Inserts a pointer part at index of this XPointer.
|
void |
addPointerPart(PointerPart pointerPart)
Appends a pointer part to the end of this XPointer.
|
void |
addPrefixNamespaceBinding(NCName prefix,
String namespace)
Adds a Prefix/Namespace binding to this XPointers contex.
|
NCName |
getNamespaceBinding(String namespace)
Gets Prefix the Namespace is bound to if the binding exists,
otherwise it will return null.
|
Object[] |
getPointerParts()
Returns the pointer parts in this XPointer.
|
String |
getPrefixBinding(NCName prefix)
Gets the Namespace the Prefix is bound to if the binding exists,
otherwise it will return null.
|
NCName |
getShorthandPointer()
Returns the shorthandPointer in this XPointer.
|
boolean |
hasNamespaceBinding(String namespace)
Checks whether a namespace is bound or not.
|
boolean |
hasPointerParts()
Tests whether this XPointer has scheme based pointers or not.
|
boolean |
hasPrefixBinding(NCName prefix)
Checks whether a prefix is bound or not.
|
boolean |
hasShorthandPointer()
Tests whether this XPointer has a shorthand pointer or not.
|
void |
setShorthandPointer(NCName shorthandPointer)
Sets the Shorthand Pointer of this XPointer to the NCName given as an argument.
|
String |
toString()
Returns a String serialisation of this XPointer.
|
public XPointer()
public XPointer(String xpointerString) throws InvalidXPointerException
xpointerString
- a String form of the XPointer to deserialise.InvalidXPointerException
public void addPointerPart(PointerPart pointerPart)
pointerPart
- the Pointer Part to append.UnsupportedOperationException()
- if a Shorthand Pointer is already set.public void addPointerPart(int index, PointerPart pointerPart)
pointerPart
- the Pointer Part to inserted.index
- an integer specifying the point to insert the pointer part.UnsupportedOperationException()
- if a Shorthand Pointer is already set.public Object[] getPointerParts()
IllegalStateException
- if this XPointer has a shorthand pointer.public void setShorthandPointer(NCName shorthandPointer)
shorthandPointer
- an NCName of the Shorthand Pointer to set.UnsupportedOperationException()
- is a PointerPart Pointer is already set.public NCName getShorthandPointer()
IllegalStateException
- if this XPointer has a shorthand pointer.public void addPrefixNamespaceBinding(NCName prefix, String namespace)
prefix
- a NCName of the prefix too bind to the namespace.namespace
- a String of the namespace to bind to the prefix.NullPointerException
- if the prefix or namespace arguments are null.IllegalArgumentException
- if the prefix or namespace are invalid as specified at http://www.w3.org/TR/xptr-framework/#nsContextpublic String getPrefixBinding(NCName prefix)
prefix
- a NCName of the prefix bound to the namespace.public NCName getNamespaceBinding(String namespace)
namespace
- a String of the prefix bound to the prefix.public boolean hasPrefixBinding(NCName prefix)
prefix
- A NCName of the prefix to check.public boolean hasNamespaceBinding(String namespace)
namespace
- A String of the namespace to check.public boolean hasShorthandPointer()
public boolean hasPointerParts()
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.