Package org.ametys.core.util.dom
Class AmetysText
- java.lang.Object
-
- org.ametys.core.util.dom.AbstractAmetysNode
-
- org.ametys.core.util.dom.AmetysText
-
- All Implemented Interfaces:
CharacterData
,Node
,Text
public class AmetysText extends AbstractAmetysNode implements Text
Partial implementation of a read-only, non-namespace awareText
on top of an objects hierarchy.
It is NOT intended to be used as a full-featured DOM implementation, but it aims to provide a thin DOM layer over objects usable e.g. in XPath expressions and XSL stylesheets.
-
-
Field Summary
-
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
-
Constructor Summary
Constructors Constructor Description AmetysText(String data, Element parent)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendData(String arg)
void
deleteData(int offset, int count)
String
getData()
int
getLength()
Node
getNextSibling()
String
getNodeName()
short
getNodeType()
String
getNodeValue()
Node
getParentNode()
String
getTextContent()
String
getWholeText()
void
insertData(int offset, String arg)
boolean
isElementContentWhitespace()
void
replaceData(int offset, int count, String arg)
Text
replaceWholeText(String content)
void
setData(String data)
Text
splitText(int offset)
String
substringData(int offset, int count)
-
Methods inherited from class org.ametys.core.util.dom.AbstractAmetysNode
_getChildNodes, appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getOwnerDocument, getPrefix, getPreviousSibling, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getOwnerDocument, getPrefix, getPreviousSibling, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
-
-
-
Constructor Detail
-
AmetysText
public AmetysText(String data, Element parent)
Constructor- Parameters:
data
- The data valueparent
- the parentElement
.
-
-
Method Detail
-
getParentNode
public Node getParentNode()
- Specified by:
getParentNode
in interfaceNode
- Overrides:
getParentNode
in classAbstractAmetysNode
-
getData
public String getData() throws DOMException
- Specified by:
getData
in interfaceCharacterData
- Throws:
DOMException
-
getLength
public int getLength()
- Specified by:
getLength
in interfaceCharacterData
-
substringData
public String substringData(int offset, int count) throws DOMException
- Specified by:
substringData
in interfaceCharacterData
- Throws:
DOMException
-
getNodeValue
public String getNodeValue() throws DOMException
- Specified by:
getNodeValue
in interfaceNode
- Overrides:
getNodeValue
in classAbstractAmetysNode
- Throws:
DOMException
-
getNodeName
public String getNodeName()
- Specified by:
getNodeName
in interfaceNode
-
getNodeType
public short getNodeType()
- Specified by:
getNodeType
in interfaceNode
-
getNextSibling
public Node getNextSibling()
- Specified by:
getNextSibling
in interfaceNode
- Overrides:
getNextSibling
in classAbstractAmetysNode
-
getTextContent
public String getTextContent() throws DOMException
- Specified by:
getTextContent
in interfaceNode
- Throws:
DOMException
-
setData
public void setData(String data) throws DOMException
- Specified by:
setData
in interfaceCharacterData
- Throws:
DOMException
-
isElementContentWhitespace
public boolean isElementContentWhitespace()
- Specified by:
isElementContentWhitespace
in interfaceText
-
getWholeText
public String getWholeText()
- Specified by:
getWholeText
in interfaceText
-
appendData
public void appendData(String arg) throws DOMException
- Specified by:
appendData
in interfaceCharacterData
- Throws:
DOMException
-
insertData
public void insertData(int offset, String arg) throws DOMException
- Specified by:
insertData
in interfaceCharacterData
- Throws:
DOMException
-
deleteData
public void deleteData(int offset, int count) throws DOMException
- Specified by:
deleteData
in interfaceCharacterData
- Throws:
DOMException
-
replaceData
public void replaceData(int offset, int count, String arg) throws DOMException
- Specified by:
replaceData
in interfaceCharacterData
- Throws:
DOMException
-
splitText
public Text splitText(int offset) throws DOMException
- Specified by:
splitText
in interfaceText
- Throws:
DOMException
-
replaceWholeText
public Text replaceWholeText(String content) throws DOMException
- Specified by:
replaceWholeText
in interfaceText
- Throws:
DOMException
-
-