Package ro.sync.outline.xml
Class Attribute
- java.lang.Object
-
- ro.sync.outline.xml.Attribute
-
@API(type=NOT_EXTENDABLE, src=PRIVATE) public class Attribute extends java.lang.Object
An attribute representation used mainly in the content completion process.
-
-
Constructor Summary
Constructors Constructor Description Attribute(java.lang.String qName, java.lang.String value, java.lang.String namespace, java.lang.String prefix)
Creates an attribute with a specified qualified name, value, namespace and prefix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getLocalName()
Gets the attribute local name.int
getNameEndOffset()
java.lang.String
getNamespace()
Gets the attribute namespace.int
getNameStartOffset()
java.lang.String
getPrefix()
java.lang.String
getQName()
Gets the attribute fully qualified name.java.lang.String
getValue()
Gets for the attribute value.int
getValueEndOffset()
int
getValueStartOffset()
boolean
hasValue()
Check if the attribute has a value, or is empty attribute.boolean
isDefaultNamespaceDeclaration()
boolean
isNamespaceDeclaration()
void
setNameEndOffset(int nameEndOffset)
void
setNamespace(java.lang.String namespace)
void
setNameStartOffset(int nameStartOffset)
void
setValueEndOffset(int valueEndOffset)
void
setValueStartOffset(int valueStartOffset)
java.lang.String
toString()
Return the string representation of the attribute.
-
-
-
Constructor Detail
-
Attribute
public Attribute(java.lang.String qName, java.lang.String value, java.lang.String namespace, java.lang.String prefix)
Creates an attribute with a specified qualified name, value, namespace and prefix.- Parameters:
qName
- The attribute fully qualified name.value
- The attribute value.namespace
- The attribute namespace.prefix
- The attribute prefix.
-
-
Method Detail
-
getQName
public java.lang.String getQName()
Gets the attribute fully qualified name.- Returns:
- The attribute qualified name of the attribute.
-
getValue
public java.lang.String getValue()
Gets for the attribute value.- Returns:
- The value. Not
null
.
-
getNamespace
public java.lang.String getNamespace()
Gets the attribute namespace.- Returns:
- The attribute namespace.
-
getLocalName
public java.lang.String getLocalName()
Gets the attribute local name.- Returns:
- The attribute local name.
-
toString
public java.lang.String toString()
Return the string representation of the attribute. It contains the attribute qualified name, the namespace and the attribute value.- Overrides:
toString
in classjava.lang.Object
-
getNameEndOffset
public int getNameEndOffset()
- Returns:
- The end offset of the name.
-
getNameStartOffset
public int getNameStartOffset()
- Returns:
- The start offset of the name.
-
getValueEndOffset
public int getValueEndOffset()
- Returns:
- The end offset of the value.
-
getValueStartOffset
public int getValueStartOffset()
- Returns:
- The start offset of the value.
-
isNamespaceDeclaration
public boolean isNamespaceDeclaration()
- Returns:
- If
true
the attribute is namespace declaration.
-
getPrefix
public java.lang.String getPrefix()
- Returns:
- Returns the attribute prefix.
-
setNamespace
public void setNamespace(java.lang.String namespace)
- Parameters:
namespace
- The attribute namespace to set.
-
setNameStartOffset
public void setNameStartOffset(int nameStartOffset)
- Parameters:
nameStartOffset
- The attribute name start offset to set.
-
setNameEndOffset
public void setNameEndOffset(int nameEndOffset)
- Parameters:
nameEndOffset
- The attribute name end offset to set.
-
setValueStartOffset
public void setValueStartOffset(int valueStartOffset)
- Parameters:
valueStartOffset
- The value start offset to set.
-
setValueEndOffset
public void setValueEndOffset(int valueEndOffset)
- Parameters:
valueEndOffset
- The value end offset to set.
-
isDefaultNamespaceDeclaration
public boolean isDefaultNamespaceDeclaration()
- Returns:
- Returns the default namespace declaration.
-
hasValue
public boolean hasValue()
Check if the attribute has a value, or is empty attribute.- Returns:
true
if it has a value,false
for empty attributes.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
-