Package de.pdark.decentxml
Class Attribute
- java.lang.Object
-
- de.pdark.decentxml.BasicNode
-
- de.pdark.decentxml.Attribute
-
-
Constructor Summary
Constructors Constructor Description Attribute(Token token)Create an attribute from a Token.Attribute(String name, String value)Create an attribute with a certain name and value.Attribute(String name, String value, char quoteChar)Create an attribute with a certain name and value plus a preference for the quote character that should be used.Attribute(String name, String value, Namespace namespace)Create an attribute with a certain name and value.Attribute(String name, String value, Namespace namespace, char quoteChar)Create an attribute with a certain name and value plus a preference for the quote character that should be used.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static charcheckQuoteChar(String value, char quoteChar)Attributecopy()Simulate clone()Attributecopy(Node orig)Copy all data fromorigintothisAttributecreateClone()Simulate clone()StringgetEqualsSpace()StringgetName()Return the name of the attributeNamespacegetNamespace()StringgetPreSpace()intgetQuoteChar()StringgetValue()Return the value of the attributeAttributesetEqualsSpace(String equalsSpace)voidsetName(String name)voidsetNamespace(Namespace namespace)AttributesetPreSpace(String preSpace)AttributesetQuoteChar(char quoteChar)voidsetValue(String value)BasicNodetoXML(XMLWriter writer)Append the content of this node towriter-
Methods inherited from class de.pdark.decentxml.BasicNode
getEndOffset, getStartOffset, getToken, getType, setType, toString, toXML, toXML
-
-
-
-
Constructor Detail
-
Attribute
public Attribute(Token token)
Create an attribute from a Token.The token must include the space before the name and end with the closing quote.
- Parameters:
token-
-
Attribute
public Attribute(String name, String value)
Create an attribute with a certain name and value.The quote to use is determined automatically depending on the content of the value
-
Attribute
public Attribute(String name, String value, Namespace namespace)
Create an attribute with a certain name and value.The quote to use is determined automatically depending on the content of the value
-
Attribute
public Attribute(String name, String value, char quoteChar)
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 Detail
-
getName
public String getName()
Return the name of the attribute
-
setName
public void setName(String name)
-
getValue
public String getValue()
Return the value of the attribute
-
getNamespace
public Namespace getNamespace()
-
setNamespace
public void setNamespace(Namespace namespace)
-
getQuoteChar
public int getQuoteChar()
-
setQuoteChar
public Attribute setQuoteChar(char quoteChar)
-
getPreSpace
public String getPreSpace()
-
getEqualsSpace
public String getEqualsSpace()
-
checkQuoteChar
public static char checkQuoteChar(String value, char quoteChar)
-
toXML
public BasicNode toXML(XMLWriter writer) throws IOException
Description copied from class:BasicNodeAppend the content of this node towriter- Specified by:
toXMLin interfaceNode- Overrides:
toXMLin classBasicNode- Throws:
IOException
-
createClone
public Attribute createClone()
Description copied from interface:NodeSimulate clone()- Specified by:
createClonein interfaceNode- Overrides:
createClonein classBasicNode
-
copy
public Attribute copy(Node orig)
Description copied from interface:NodeCopy all data fromorigintothis
-
-