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 char
checkQuoteChar
(String value, char quoteChar) copy()
Simulate clone()Copy all data fromorig
intothis
Simulate clone()getName()
Return the name of the attributeint
getValue()
Return the value of the attributesetEqualsSpace
(String equalsSpace) void
void
setNamespace
(Namespace namespace) setPreSpace
(String preSpace) setQuoteChar
(char quoteChar) void
Append the content of this node towriter
Methods 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:BasicNode
Append the content of this node towriter
- Specified by:
toXML
in interfaceNode
- Overrides:
toXML
in classBasicNode
- Throws:
IOException
-
createClone
Description copied from interface:Node
Simulate clone()- Specified by:
createClone
in interfaceNode
- Overrides:
createClone
in classBasicNode
-
copy
Description copied from interface:Node
Copy all data fromorig
intothis
-
copy
Description copied from interface:Node
Simulate clone()
-