javax.imageio.metadata

Class IIOMetadataFormatImpl

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 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)
abstract boolean
canNodeAppear(String elementName, ImageTypeSpecifier specifier)
protected
extends Object & Comparable> void addObjectValue(String elementName, Class classType, T defaultValue, T> minValue, T> maxValue, boolean minInclusive, boolean maxInclusive)
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)
protected
void addObjectValue(String elementName, Class classType, boolean required, T defaultValue)
protected
void addObjectValue(String elementName, Class classType, boolean required, T defaultValue, T> enumeratedValues)

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

standardMetadataFormatName

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

Constructor Details

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 Details

addAttribute

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

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 enumeratedValues)

addAttribute

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

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 void addObjectValue(String elementName,
                              Class classType,
                              int arrayMinLength,
                              int arrayMaxLength)

canNodeAppear

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

extends Object & Comparable> void addObjectValue

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

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

getResourceBaseName

protected String getResourceBaseName()

getRootName

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

getStandardFormatInstance

public static IIOMetadataFormat getStandardFormatInstance()

isAttributeRequired

public boolean isAttributeRequired(String elementName,
                                   String attrName)
Specified by:
isAttributeRequired 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)

void addObjectValue

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

void addObjectValue

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

IIOMetadataFormatImpl.java -- Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.