Package de.pdark.decentxml
Class Attribute
java.lang.Object
de.pdark.decentxml.BasicNode
de.pdark.decentxml.Attribute
- All Implemented Interfaces:
Node
This class represents an attribute of an
Element- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate an attribute from a Token.Create an attribute with a certain name and value.Create an attribute with a certain name and value plus a preference for the quote character that should be used.Create an attribute with a certain name and value.Create an attribute with a certain name and value plus a preference for the quote character that should be used. -
Method Summary
Modifier and TypeMethodDescriptionstatic charcheckQuoteChar(String value, char quoteChar) copy()Simulate clone()Copy all data fromorigintothisSimulate clone()getName()Return the name of the attributeintgetValue()Return the value of the attributesetEqualsSpace(String equalsSpace) voidvoidsetNamespace(Namespace namespace) setPreSpace(String preSpace) setQuoteChar(char quoteChar) voidAppend the content of this node towriterMethods inherited from class de.pdark.decentxml.BasicNode
getEndOffset, getStartOffset, getToken, getType, setType, toString, toXML, toXML
-
Field Details
-
namespace
-
preSpace
Space before the name -
name
-
equalsSpace
Space around the equals sign (incl. the sign) -
rawValue
-
value
-
quoteChar
private char quoteChar
-
-
Constructor Details
-
Attribute
Create an attribute from a Token.The token must include the space before the name and end with the closing quote.
- Parameters:
token-
-
Attribute
Create an attribute with a certain name and value.The quote to use is determined automatically depending on the content of the value
-
Attribute
Create an attribute with a certain name and value.The quote to use is determined automatically depending on the content of the value
-
Attribute
Create an attribute with a certain name and value plus a preference for the quote character that should be used.If the quote character exists in the value, it is ignored.
-
Attribute
Create an attribute with a certain name and value plus a preference for the quote character that should be used.If the quote character exists in the value, it is ignored.
-
-
Method Details
-
getName
Return the name of the attribute -
setName
-
getValue
Return the value of the attribute -
setValue
-
getNamespace
-
setNamespace
-
getQuoteChar
public int getQuoteChar() -
setQuoteChar
-
getPreSpace
-
setPreSpace
-
getEqualsSpace
-
setEqualsSpace
-
checkQuoteChar
-
toXML
Description copied from class:BasicNodeAppend the content of this node towriter- Specified by:
toXMLin interfaceNode- Overrides:
toXMLin classBasicNode- Throws:
IOException
-
createClone
Description copied from interface:NodeSimulate clone()- Specified by:
createClonein interfaceNode- Overrides:
createClonein classBasicNode
-
copy
Description copied from interface:NodeCopy all data fromorigintothis -
copy
Description copied from interface:NodeSimulate clone()
-