Package com.adobe.xfa
Class Attribute
java.lang.Object
com.adobe.xfa.Attribute
- Direct Known Subclasses:
EnumValue,GenericAttribute,ImagingBBoxEnum,Int,Measurement,Rotate,StringAttr
A common base class to represent XML attributes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringGets this attribute's value.final StringGets this attribute's local name.final StringgetName()Gets this attribute's local name.getNS()Gets this attribute's namespace.final StringGets this attribute's namespace prefix.final StringgetQName()Gets this attribute's qualified name.final booleanisEmpty()Determines if this attribute's value is empty (or null).final booleanDetermines if this attribute is a name space attribute.booleanDetermine if an attribute is a schema attribute.final booleanthe URI for xsi has many variants by date e.g.abstract AttributenewAttribute(String value) Create a new attribute, given a new valueabstract AttributenewAttribute(String NS, String localName, String qName, String value) Create a new attribute, given all attribute parametersabstract AttributenewAttribute(String NS, String localName, String qName, String value, boolean internSymbols) Create a new attribute, given all attribute parametersvoidNormalizes this attribute.toString()Generates this attribute's value as a string.
-
Constructor Details
-
Attribute
Instantiates an attribute, with the given attribute value.- Parameters:
qName- the attribute name.value- the attribute value.
-
Attribute
Instantiates an attribute, with the given attribute parameters.- Parameters:
NS- the namespace of this attribute.localName- the local name of this attribute.qName- the qualified name of this attribute.value- the value of this attribute.
-
-
Method Details
-
getAttrValue
Gets this attribute's value.- Returns:
- the attribute value.
-
getLocalName
Gets this attribute's local name.- Returns:
- The local part of the name (everything after the ":")
-
getName
Gets this attribute's local name.- Returns:
- Returns the local name.
-
getNS
Gets this attribute's namespace.- Returns:
- Returns the namespace.
-
getPrefix
Gets this attribute's namespace prefix.- Returns:
- the attribute namespace prefix.
-
getQName
Gets this attribute's qualified name.- Returns:
- the qualified name.
-
isEmpty
public final boolean isEmpty()Determines if this attribute's value is empty (or null).- Returns:
- true if this attribute's value is empty and false otherwise.
-
isNameSpaceAttr
public final boolean isNameSpaceAttr()Determines if this attribute is a name space attribute.- Returns:
- true if this is a name space attribute and false otherwise.
-
isXSINilAttr
public final boolean isXSINilAttr()the URI for xsi has many variants by date e.g. http://www.w3.org/[this section may vary]/XMLSchema-instance Pre-2001 used the "null" attribute, the 2001 version rename this to "nil" We recognize any combination of nil or null with any XMLSchema-instance namespace URI.- Returns:
- true if this attribute represents the xsi:nil attribute, or one of its variants.
-
isSchemaAttr
public boolean isSchemaAttr()Determine if an attribute is a schema attribute.- Returns:
- true this is a schema attribute.
-
newAttribute
Create a new attribute, given a new value- Parameters:
value- the string to use to create the new attribute- Returns:
- a new attribute
-
newAttribute
Create a new attribute, given all attribute parameters- Parameters:
NS- the namespace for this attributelocalName- the local name for this attributeqName- the qualified name for this attributevalue- the string to use to create the new attribute- Returns:
- a new attribute
-
newAttribute
public abstract Attribute newAttribute(String NS, String localName, String qName, String value, boolean internSymbols) Create a new attribute, given all attribute parameters- Parameters:
NS- the namespace for this attributelocalName- the local name for this attributeqName- the qualified name for this attributevalue- the string to use to create the new attributeinternSymbols- indicates whether the symbols in other parameters need to be interned.- Returns:
- a new attribute
-
normalize
public void normalize()Normalizes this attribute. This base class implementation simply does nothing, other than allow derived classes the opportunity to do something. -
toString
Generates this attribute's value as a string.
-