Package org.apache.batik.anim.dom
Class AttributeInitializer
- java.lang.Object
-
- org.apache.batik.anim.dom.AttributeInitializer
-
public class AttributeInitializer extends java.lang.ObjectThis class is used by elements to initialize and reset their attributes.- Version:
- $Id: AttributeInitializer.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]keysThe list of namespaces, prefixes and names.protected intlengthThe length of keys.protected DoublyIndexedTablevaluesThe attribute values table.
-
Constructor Summary
Constructors Constructor Description AttributeInitializer(int capacity)Creates a new AttributeInitializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(java.lang.String ns, java.lang.String prefix, java.lang.String ln, java.lang.String val)Adds a default attribute value to the initializer.voidinitializeAttributes(AbstractElement elt)Initializes the attributes of the given element.booleanresetAttribute(AbstractElement elt, java.lang.String ns, java.lang.String prefix, java.lang.String ln)Resets an attribute of the given element to its default value.
-
-
-
Field Detail
-
keys
protected java.lang.String[] keys
The list of namespaces, prefixes and names.
-
length
protected int length
The length of keys.
-
values
protected DoublyIndexedTable values
The attribute values table.
-
-
Method Detail
-
addAttribute
public void addAttribute(java.lang.String ns, java.lang.String prefix, java.lang.String ln, java.lang.String val)Adds a default attribute value to the initializer.- Parameters:
ns- The attribute namespace URI.prefix- The attribute's name prefix, or null.ln- The attribute's local name.val- The attribute's default value.
-
initializeAttributes
public void initializeAttributes(AbstractElement elt)
Initializes the attributes of the given element.
-
resetAttribute
public boolean resetAttribute(AbstractElement elt, java.lang.String ns, java.lang.String prefix, java.lang.String ln)
Resets an attribute of the given element to its default value.- Parameters:
elt- The element to modify.ns- The attribute namespace URI.prefix- The attribute's name prefix.ln- The attribute's local name.- Returns:
- true if a default value is known for the given attribute and if it was resetted.
-
-