Package ro.sync.outline.xml
Class Attribute
java.lang.Object
ro.sync.outline.xml.Attribute
An attribute representation used mainly in the content completion process.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the attribute local name.intGets the attribute namespace.intgetQName()Gets the attribute fully qualified name.getValue()Gets for the attribute value.intintbooleanhasValue()Check if the attribute has a value, or is empty attribute.booleanbooleanvoidsetNameEndOffset(int nameEndOffset) voidsetNamespace(String namespace) voidsetNameStartOffset(int nameStartOffset) voidsetValueEndOffset(int valueEndOffset) voidsetValueStartOffset(int valueStartOffset) toString()Return the string representation of the attribute.
-
Constructor Details
-
Attribute
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 Details
-
getQName
Gets the attribute fully qualified name.- Returns:
- The attribute qualified name of the attribute.
-
getValue
Gets for the attribute value.- Returns:
- The value. Not
null.
-
getNamespace
Gets the attribute namespace.- Returns:
- The attribute namespace.
-
getLocalName
Gets the attribute local name.- Returns:
- The attribute local name.
-
toString
Return the string representation of the attribute. It contains the attribute qualified name, the namespace and the attribute value. -
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
truethe attribute is namespace declaration.
-
getPrefix
- Returns:
- Returns the attribute prefix.
-
setNamespace
- 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:
trueif it has a value,falsefor empty attributes.
-
equals
-