javax.imageio.metadata
Class IIOMetadataFormatImpl

java.lang.Object
  extended by javax.imageio.metadata.IIOMetadataFormatImpl
All Implemented Interfaces:
IIOMetadataFormat

public abstract class IIOMetadataFormatImpl
extends Object
implements IIOMetadataFormat


Field Summary
static String standardMetadataFormatName
          The standard metadata format name constant set to "javax_imageio_1.0".
 
Fields inherited from interface javax.imageio.metadata.IIOMetadataFormat
CHILD_POLICY_ALL, CHILD_POLICY_CHOICE, CHILD_POLICY_EMPTY, CHILD_POLICY_MAX, CHILD_POLICY_REPEAT, CHILD_POLICY_SEQUENCE, CHILD_POLICY_SOME, DATATYPE_BOOLEAN, DATATYPE_DOUBLE, DATATYPE_FLOAT, DATATYPE_INTEGER, DATATYPE_STRING, VALUE_ARBITRARY, VALUE_ENUMERATION, VALUE_LIST, VALUE_NONE, VALUE_RANGE, VALUE_RANGE_MAX_INCLUSIVE, VALUE_RANGE_MAX_INCLUSIVE_MASK, VALUE_RANGE_MIN_INCLUSIVE, VALUE_RANGE_MIN_INCLUSIVE_MASK, VALUE_RANGE_MIN_MAX_INCLUSIVE
 
Constructor Summary
IIOMetadataFormatImpl(String rootName, int childPolicy)
          Construct a blank IIOMetadataFormatImpl with the given root name and child policy.
IIOMetadataFormatImpl(String rootName, int minChildren, int maxChildren)
          Construct a blank IIOMetadataFormatImpl with the given root name, a child policy of CHILD_POLICY_REPEAT and the given minimum and maximum limits on the number of root element children.
 
Method Summary
protected  void addAttribute(String elementName, String attrName, int dataType, boolean required, int listMinLength, int listMaxLength)
           
protected  void addAttribute(String elementName, String attrName, int dataType, boolean required, String defaultValue)
           
protected  void addAttribute(String elementName, String attrName, int dataType, boolean required, String defaultValue, List<String> enumeratedValues)
           
protected  void addAttribute(String elementName, String attrName, int dataType, boolean required, String defaultValue, String minValue, String maxValue, boolean minInclusive, boolean maxInclusive)
           
protected  void addBooleanAttribute(String elementName, String attrName, boolean hasDefaultValue, boolean defaultValue)
           
protected  void addChildElement(String elementName, String parentName)
           
protected  void addElement(String elementName, String parentName, int childPolicy)
           
protected  void addElement(String elementName, String parentName, int minChildren, int maxChildren)
           
protected  void addObjectValue(String elementName, Class<?> classType, int arrayMinLength, int arrayMaxLength)
           
protected
<T> void
addObjectValue(String elementName, Class<T> classType, boolean required, T defaultValue)
           
protected
<T> void
addObjectValue(String elementName, Class<T> classType, boolean required, T defaultValue, List<? extends T> enumeratedValues)
           
protected
<T extends Object & Comparable<? super T>>
void
addObjectValue(String elementName, Class<T> classType, T defaultValue, Comparable<? super T> minValue, Comparable<? super T> maxValue, boolean minInclusive, boolean maxInclusive)
           
abstract  boolean canNodeAppear(String elementName, ImageTypeSpecifier specifier)
           
 int getAttributeDataType(String elementName, String attrName)
           
 String getAttributeDefaultValue(String elementName, String attrName)
           
 String getAttributeDescription(String elementName, String attrName, Locale locale)
           
 String[] getAttributeEnumerations(String elementName, String attrName)
           
 int getAttributeListMaxLength(String elementName, String attrName)
           
 int getAttributeListMinLength(String elementName, String attrName)
           
 String getAttributeMaxValue(String elementName, String attrName)
           
 String getAttributeMinValue(String elementName, String attrName)
           
 String[] getAttributeNames(String elementName)
           
 int getAttributeValueType(String elementName, String attrName)
           
 String[] getChildNames(String elementName)
           
 int getChildPolicy(String elementName)
           
 String getElementDescription(String elementName, Locale locale)
           
 int getElementMaxChildren(String elementName)
           
 int getElementMinChildren(String elementName)
           
 int getObjectArrayMaxLength(String elementName)
           
 int getObjectArrayMinLength(String elementName)
           
 Class<?> getObjectClass(String elementName)
           
 Object getObjectDefaultValue(String elementName)
           
 Object[] getObjectEnumerations(String elementName)
           
 Comparable<?> getObjectMaxValue(String elementName)
           
 Comparable<?> getObjectMinValue(String elementName)
           
 int getObjectValueType(String elementName)
           
protected  String getResourceBaseName()
           
 String getRootName()
           
static IIOMetadataFormat getStandardFormatInstance()
           
 boolean isAttributeRequired(String elementName, String attrName)
           
protected  void removeAttribute(String elementName, String attrName)
           
protected  void removeElement(String elementName)
           
protected  void removeObjectValue(String elementName)
           
protected  void setResourceBaseName(String resourceBaseName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

standardMetadataFormatName

public static final String standardMetadataFormatName
The standard metadata format name constant set to "javax_imageio_1.0".

See Also:
Constant Field Values
Constructor Detail

IIOMetadataFormatImpl

public IIOMetadataFormatImpl(String rootName,
                             int childPolicy)
Construct a blank IIOMetadataFormatImpl with the given root name and child policy.

Parameters:
rootName - the root element name
childPolicy - the child policy of the root element
Throws:
IllegalArgumentException - if rootName is null
IllegalArgumentException - if childPolicy is CHILD_POLICY_REPEAT or if childPolicy is not a CHILD_POLICY constant

IIOMetadataFormatImpl

public IIOMetadataFormatImpl(String rootName,
                             int minChildren,
                             int maxChildren)
Construct a blank IIOMetadataFormatImpl with the given root name, a child policy of CHILD_POLICY_REPEAT and the given minimum and maximum limits on the number of root element children.

Parameters:
rootName - the root element name
minChildren - the minimum number of children that this node can have
maxChildren - the maximum number of children that this node can have
Throws:
IllegalArgumentException - if rootName is null
IllegalArgumentException - if minChildren is less than zero or greater than maxChildren
Method Detail

addAttribute

protected void addAttribute(String elementName,
                            String attrName,
                            int dataType,
                            boolean required,
                            String defaultValue)

addAttribute

protected void addAttribute(String elementName,
                            String attrName,
                            int dataType,
                            boolean required,
                            String defaultValue,
                            List<String> enumeratedValues)

addAttribute

protected void addAttribute(String elementName,
                            String attrName,
                            int dataType,
                            boolean required,
                            String defaultValue,
                            String minValue,
                            String maxValue,
                            boolean minInclusive,
                            boolean maxInclusive)

addAttribute

protected void addAttribute(String elementName,
                            String attrName,
                            int dataType,
                            boolean required,
                            int listMinLength,
                            int listMaxLength)

addBooleanAttribute

protected void addBooleanAttribute(String elementName,
                                   String attrName,
                                   boolean hasDefaultValue,
                                   boolean defaultValue)

addChildElement

protected void addChildElement(String elementName,
                               String parentName)

addElement

protected void addElement(String elementName,
                          String parentName,
                          int childPolicy)

addElement

protected void addElement(String elementName,
                          String parentName,
                          int minChildren,
                          int maxChildren)

addObjectValue

protected <T> void addObjectValue(String elementName,
                                  Class<T> classType,
                                  boolean required,
                                  T defaultValue)

addObjectValue

protected <T> void addObjectValue(String elementName,
                                  Class<T> classType,
                                  boolean required,
                                  T defaultValue,
                                  List<? extends T> enumeratedValues)

addObjectValue

protected <T extends Object & Comparable<? super T>> void addObjectValue(String elementName,
                                                                        Class<T> classType,
                                                                        T defaultValue,
                                                                        Comparable<? super T> minValue,
                                                                        Comparable<? super T> maxValue,
                                                                        boolean minInclusive,
                                                                        boolean maxInclusive)

addObjectValue

protected void addObjectValue(String elementName,
                              Class<?> classType,
                              int arrayMinLength,
                              int arrayMaxLength)

getRootName

public String getRootName()
Specified by:
getRootName in interface IIOMetadataFormat

getResourceBaseName

protected String getResourceBaseName()

getStandardFormatInstance

public static IIOMetadataFormat getStandardFormatInstance()

canNodeAppear

public abstract boolean canNodeAppear(String elementName,
                                      ImageTypeSpecifier specifier)
Specified by:
canNodeAppear in interface IIOMetadataFormat

removeAttribute

protected void removeAttribute(String elementName,
                               String attrName)

removeElement

protected void removeElement(String elementName)

removeObjectValue

protected void removeObjectValue(String elementName)

setResourceBaseName

protected void setResourceBaseName(String resourceBaseName)

getAttributeDataType

public int getAttributeDataType(String elementName,
                                String attrName)
Specified by:
getAttributeDataType in interface IIOMetadataFormat

getAttributeDefaultValue

public String getAttributeDefaultValue(String elementName,
                                       String attrName)
Specified by:
getAttributeDefaultValue in interface IIOMetadataFormat

getAttributeDescription

public String getAttributeDescription(String elementName,
                                      String attrName,
                                      Locale locale)
Specified by:
getAttributeDescription in interface IIOMetadataFormat

getAttributeEnumerations

public String[] getAttributeEnumerations(String elementName,
                                         String attrName)
Specified by:
getAttributeEnumerations in interface IIOMetadataFormat

getAttributeListMaxLength

public int getAttributeListMaxLength(String elementName,
                                     String attrName)
Specified by:
getAttributeListMaxLength in interface IIOMetadataFormat

getAttributeListMinLength

public int getAttributeListMinLength(String elementName,
                                     String attrName)
Specified by:
getAttributeListMinLength in interface IIOMetadataFormat

getAttributeMaxValue

public String getAttributeMaxValue(String elementName,
                                   String attrName)
Specified by:
getAttributeMaxValue in interface IIOMetadataFormat

getAttributeMinValue

public String getAttributeMinValue(String elementName,
                                   String attrName)
Specified by:
getAttributeMinValue in interface IIOMetadataFormat

getAttributeNames

public String[] getAttributeNames(String elementName)
Specified by:
getAttributeNames in interface IIOMetadataFormat

getAttributeValueType

public int getAttributeValueType(String elementName,
                                 String attrName)
Specified by:
getAttributeValueType in interface IIOMetadataFormat

getChildNames

public String[] getChildNames(String elementName)
Specified by:
getChildNames in interface IIOMetadataFormat

getChildPolicy

public int getChildPolicy(String elementName)
Specified by:
getChildPolicy in interface IIOMetadataFormat

getElementDescription

public String getElementDescription(String elementName,
                                    Locale locale)
Specified by:
getElementDescription in interface IIOMetadataFormat

getElementMaxChildren

public int getElementMaxChildren(String elementName)
Specified by:
getElementMaxChildren in interface IIOMetadataFormat

getElementMinChildren

public int getElementMinChildren(String elementName)
Specified by:
getElementMinChildren in interface IIOMetadataFormat

getObjectArrayMaxLength

public int getObjectArrayMaxLength(String elementName)
Specified by:
getObjectArrayMaxLength in interface IIOMetadataFormat

getObjectArrayMinLength

public int getObjectArrayMinLength(String elementName)
Specified by:
getObjectArrayMinLength in interface IIOMetadataFormat

getObjectClass

public Class<?> getObjectClass(String elementName)
Specified by:
getObjectClass in interface IIOMetadataFormat

getObjectDefaultValue

public Object getObjectDefaultValue(String elementName)
Specified by:
getObjectDefaultValue in interface IIOMetadataFormat

getObjectEnumerations

public Object[] getObjectEnumerations(String elementName)
Specified by:
getObjectEnumerations in interface IIOMetadataFormat

getObjectMaxValue

public Comparable<?> getObjectMaxValue(String elementName)
Specified by:
getObjectMaxValue in interface IIOMetadataFormat

getObjectMinValue

public Comparable<?> getObjectMinValue(String elementName)
Specified by:
getObjectMinValue in interface IIOMetadataFormat

getObjectValueType

public int getObjectValueType(String elementName)
Specified by:
getObjectValueType in interface IIOMetadataFormat

isAttributeRequired

public boolean isAttributeRequired(String elementName,
                                   String attrName)
Specified by:
isAttributeRequired in interface IIOMetadataFormat