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 awareTexton 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 voidappendData(String arg)voiddeleteData(int offset, int count)StringgetData()intgetLength()NodegetNextSibling()StringgetNodeName()shortgetNodeType()StringgetNodeValue()NodegetParentNode()StringgetTextContent()StringgetWholeText()voidinsertData(int offset, String arg)booleanisElementContentWhitespace()voidreplaceData(int offset, int count, String arg)TextreplaceWholeText(String content)voidsetData(String data)TextsplitText(int offset)StringsubstringData(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:
getParentNodein interfaceNode- Overrides:
getParentNodein classAbstractAmetysNode
-
getData
public String getData() throws DOMException
- Specified by:
getDatain interfaceCharacterData- Throws:
DOMException
-
getLength
public int getLength()
- Specified by:
getLengthin interfaceCharacterData
-
substringData
public String substringData(int offset, int count) throws DOMException
- Specified by:
substringDatain interfaceCharacterData- Throws:
DOMException
-
getNodeValue
public String getNodeValue() throws DOMException
- Specified by:
getNodeValuein interfaceNode- Overrides:
getNodeValuein classAbstractAmetysNode- Throws:
DOMException
-
getNodeName
public String getNodeName()
- Specified by:
getNodeNamein interfaceNode
-
getNodeType
public short getNodeType()
- Specified by:
getNodeTypein interfaceNode
-
getNextSibling
public Node getNextSibling()
- Specified by:
getNextSiblingin interfaceNode- Overrides:
getNextSiblingin classAbstractAmetysNode
-
getTextContent
public String getTextContent() throws DOMException
- Specified by:
getTextContentin interfaceNode- Throws:
DOMException
-
setData
public void setData(String data) throws DOMException
- Specified by:
setDatain interfaceCharacterData- Throws:
DOMException
-
isElementContentWhitespace
public boolean isElementContentWhitespace()
- Specified by:
isElementContentWhitespacein interfaceText
-
getWholeText
public String getWholeText()
- Specified by:
getWholeTextin interfaceText
-
appendData
public void appendData(String arg) throws DOMException
- Specified by:
appendDatain interfaceCharacterData- Throws:
DOMException
-
insertData
public void insertData(int offset, String arg) throws DOMException
- Specified by:
insertDatain interfaceCharacterData- Throws:
DOMException
-
deleteData
public void deleteData(int offset, int count) throws DOMException
- Specified by:
deleteDatain interfaceCharacterData- Throws:
DOMException
-
replaceData
public void replaceData(int offset, int count, String arg) throws DOMException
- Specified by:
replaceDatain interfaceCharacterData- Throws:
DOMException
-
splitText
public Text splitText(int offset) throws DOMException
- Specified by:
splitTextin interfaceText- Throws:
DOMException
-
replaceWholeText
public Text replaceWholeText(String content) throws DOMException
- Specified by:
replaceWholeTextin interfaceText- Throws:
DOMException
-
-