Package com.adobe.xfa
Class Attribute
- java.lang.Object
-
- com.adobe.xfa.Attribute
-
- Direct Known Subclasses:
EnumValue
,GenericAttribute
,ImagingBBoxEnum
,Int
,Measurement
,Rotate
,StringAttr
public abstract class Attribute extends java.lang.Object
A common base class to represent XML attributes.
-
-
Constructor Summary
Constructors Constructor Description Attribute(java.lang.String qName, java.lang.String value)
Instantiates an attribute, with the given attribute value.Attribute(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.String value)
Instantiates an attribute, with the given attribute parameters.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAttrValue()
Gets this attribute's value.java.lang.String
getLocalName()
Gets this attribute's local name.java.lang.String
getName()
Gets this attribute's local name.java.lang.String
getNS()
Gets this attribute's namespace.java.lang.String
getPrefix()
Gets this attribute's namespace prefix.java.lang.String
getQName()
Gets this attribute's qualified name.boolean
isEmpty()
Determines if this attribute's value is empty (or null).boolean
isNameSpaceAttr()
Determines if this attribute is a name space attribute.boolean
isSchemaAttr()
Determine if an attribute is a schema attribute.boolean
isXSINilAttr()
the URI for xsi has many variants by date e.g.abstract Attribute
newAttribute(java.lang.String value)
Create a new attribute, given a new valueabstract Attribute
newAttribute(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.String value)
Create a new attribute, given all attribute parametersabstract Attribute
newAttribute(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.String value, boolean internSymbols)
Create a new attribute, given all attribute parametersvoid
normalize()
Normalizes this attribute.java.lang.String
toString()
Generates this attribute's value as a string.
-
-
-
Constructor Detail
-
Attribute
public Attribute(java.lang.String qName, java.lang.String value)
Instantiates an attribute, with the given attribute value.- Parameters:
qName
- the attribute name.value
- the attribute value.
-
Attribute
public Attribute(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.String value)
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 Detail
-
getAttrValue
public final java.lang.String getAttrValue()
Gets this attribute's value.- Returns:
- the attribute value.
-
getLocalName
public final java.lang.String getLocalName()
Gets this attribute's local name.- Returns:
- The local part of the name (everything after the ":")
-
getName
public final java.lang.String getName()
Gets this attribute's local name.- Returns:
- Returns the local name.
-
getNS
public java.lang.String getNS()
Gets this attribute's namespace.- Returns:
- Returns the namespace.
-
getPrefix
public final java.lang.String getPrefix()
Gets this attribute's namespace prefix.- Returns:
- the attribute namespace prefix.
-
getQName
public final java.lang.String 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
public abstract Attribute newAttribute(java.lang.String value)
Create a new attribute, given a new value- Parameters:
value
- the string to use to create the new attribute- Returns:
- a new attribute
-
newAttribute
public abstract Attribute newAttribute(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.String value)
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(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.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
public java.lang.String toString()
Generates this attribute's value as a string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the attribute value.
- See Also:
Object.toString()
-
-