Package de.pdark.decentxml
Class Attribute
- java.lang.Object
-
- de.pdark.decentxml.BasicNode
-
- de.pdark.decentxml.Attribute
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringequalsSpaceSpace around the equals sign (incl.private java.lang.Stringnameprivate Namespacenamespaceprivate java.lang.StringpreSpaceSpace before the nameprivate charquoteCharprivate java.lang.StringrawValueprivate java.lang.Stringvalue
-
Constructor Summary
Constructors Constructor Description Attribute(Token token)Create an attribute from a Token.Attribute(java.lang.String name, java.lang.String value)Create an attribute with a certain name and value.Attribute(java.lang.String name, java.lang.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(java.lang.String name, java.lang.String value, Namespace namespace)Create an attribute with a certain name and value.Attribute(java.lang.String name, java.lang.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(java.lang.String value, char quoteChar)Attributecopy()Simulate clone()Attributecopy(Node orig)Copy all data fromorigintothisAttributecreateClone()Simulate clone()java.lang.StringgetEqualsSpace()java.lang.StringgetName()Return the name of the attributeNamespacegetNamespace()java.lang.StringgetPreSpace()intgetQuoteChar()java.lang.StringgetValue()Return the value of the attributeAttributesetEqualsSpace(java.lang.String equalsSpace)voidsetName(java.lang.String name)voidsetNamespace(Namespace namespace)AttributesetPreSpace(java.lang.String preSpace)AttributesetQuoteChar(char quoteChar)voidsetValue(java.lang.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
-
-
-
-
Field Detail
-
namespace
private Namespace namespace
-
preSpace
private java.lang.String preSpace
Space before the name
-
name
private java.lang.String name
-
equalsSpace
private java.lang.String equalsSpace
Space around the equals sign (incl. the sign)
-
rawValue
private java.lang.String rawValue
-
value
private java.lang.String value
-
quoteChar
private char quoteChar
-
-
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(java.lang.String name, java.lang.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(java.lang.String name, java.lang.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(java.lang.String name, java.lang.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.
-
Attribute
public Attribute(java.lang.String name, java.lang.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.If the quote character exists in the value, it is ignored.
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the name of the attribute
-
setName
public void setName(java.lang.String name)
-
getValue
public java.lang.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 java.lang.String getPreSpace()
-
setPreSpace
public Attribute setPreSpace(java.lang.String preSpace)
-
getEqualsSpace
public java.lang.String getEqualsSpace()
-
setEqualsSpace
public Attribute setEqualsSpace(java.lang.String equalsSpace)
-
checkQuoteChar
public static char checkQuoteChar(java.lang.String value, char quoteChar)
-
toXML
public BasicNode toXML(XMLWriter writer) throws java.io.IOException
Description copied from class:BasicNodeAppend the content of this node towriter
-
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
-
-