Modifier and Type | Field and Description |
---|---|
private java.lang.String |
equalsSpace
Space around the equals sign (incl.
|
private java.lang.String |
name |
private Namespace |
namespace |
private java.lang.String |
preSpace
Space before the name
|
private char |
quoteChar |
private java.lang.String |
rawValue |
private java.lang.String |
value |
Constructor and Description |
---|
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.
|
Attribute(Token token)
Create an attribute from a Token.
|
Modifier and Type | Method and Description |
---|---|
static char |
checkQuoteChar(java.lang.String value,
char quoteChar) |
Attribute |
copy()
Simulate clone()
|
Attribute |
copy(Node orig)
Copy all data from
orig into this |
Attribute |
createClone()
Simulate clone()
|
java.lang.String |
getEqualsSpace() |
java.lang.String |
getName()
Return the name of the attribute
|
Namespace |
getNamespace() |
java.lang.String |
getPreSpace() |
int |
getQuoteChar() |
java.lang.String |
getValue()
Return the value of the attribute
|
Attribute |
setEqualsSpace(java.lang.String equalsSpace) |
void |
setName(java.lang.String name) |
void |
setNamespace(Namespace namespace) |
Attribute |
setPreSpace(java.lang.String preSpace) |
Attribute |
setQuoteChar(char quoteChar) |
void |
setValue(java.lang.String value) |
BasicNode |
toXML(XMLWriter writer)
Append the content of this node to
writer |
getEndOffset, getStartOffset, getToken, getType, setType, toString, toXML, toXML
private Namespace namespace
private java.lang.String preSpace
private java.lang.String name
private java.lang.String equalsSpace
private java.lang.String rawValue
private java.lang.String value
private char quoteChar
public Attribute(Token token)
The token must include the space before the name and end with the closing quote.
token
- public Attribute(java.lang.String name, java.lang.String value)
The quote to use is determined automatically depending on the content of the value
public Attribute(java.lang.String name, java.lang.String value, Namespace namespace)
The quote to use is determined automatically depending on the content of the value
public Attribute(java.lang.String name, java.lang.String value, char quoteChar)
If the quote character exists in the value, it is ignored.
public Attribute(java.lang.String name, java.lang.String value, Namespace namespace, char quoteChar)
If the quote character exists in the value, it is ignored.
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getValue()
public Namespace getNamespace()
public void setNamespace(Namespace namespace)
public int getQuoteChar()
public Attribute setQuoteChar(char quoteChar)
public java.lang.String getPreSpace()
public Attribute setPreSpace(java.lang.String preSpace)
public java.lang.String getEqualsSpace()
public Attribute setEqualsSpace(java.lang.String equalsSpace)
public static char checkQuoteChar(java.lang.String value, char quoteChar)
public BasicNode toXML(XMLWriter writer) throws java.io.IOException
BasicNode
writer
public Attribute createClone()
Node
createClone
in interface Node
createClone
in class BasicNode
public Attribute copy(Node orig)
Node
orig
into this