IIOMetadataFormat
interface. In addition, a static
instance representing the standard, plug-in neutral
javax_imageio_1.0
format is provided by the
getStandardFormatInstance
method.
In order to supply localized descriptions of elements and
attributes, a ResourceBundle
with a base name of
this.getClass().getName() + "Resources"
should be
supplied via the usual mechanism used by
ResourceBundle.getBundle
. Briefly, the subclasser
supplies one or more additional classes according to a naming
convention (by default, the fully-qualified name of the subclass
extending IIMetadataFormatImpl
, plus the string
"Resources", plus the country, language, and variant codes
separated by underscores). At run time, calls to
getElementDescription
or
getAttributeDescription
will attempt to load such
classes dynamically according to the supplied locale, and will use
either the element name, or the element name followed by a '/'
character followed by the attribute name as a key. This key will
be supplied to the ResourceBundle
's
getString
method, and the resulting localized
description of the node or attribute is returned.
The subclass may supply a different base name for the resource
bundles using the setResourceBaseName
method.
A subclass may choose its own localization mechanism, if so
desired, by overriding the supplied implementations of
getElementDescription
and
getAttributeDescription
.
ResourceBundle#getBundle(String, Locale)
Modifier and Type | Class and Description |
---|---|
pack-priv static class | |
pack-priv static class | |
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private HashMap | |
private String | |
private String | |
private static IIOMetadataFormat | |
public static final String | standardMetadataFormatName
A |
Access | Constructor and Description |
---|---|
public | IIOMetadataFormatImpl(String
the name of the root element. rootName, int one of the childPolicy)CHILD_POLICY_* constants,
other than CHILD_POLICY_REPEAT .Constructs a blank |
public | IIOMetadataFormatImpl(String
the name of the root element. rootName, int the minimum number of children of the node. minChildren, int the maximum number of children of the node. maxChildren)Constructs a blank |
Modifier and Type | Method and Description |
---|---|
protected void | addAttribute(String
the name of the element. elementName, String the name of the attribute being added. attrName, int the data type (string format) of the attribute,
one of the dataType, boolean DATATYPE_* constants.true if the attribute must be present.the default value for the attribute, or
defaultValue)null .Adds a new attribute to a previously defined element that may be set to an arbitrary value. |
protected void | addAttribute(String
the name of the element. elementName, String the name of the attribute being added. attrName, int the data type (string format) of the attribute,
one of the dataType, boolean DATATYPE_* constants.true if the attribute must be present.the default value for the attribute, or
defaultValue, List<String> null .a enumeratedValues)List of
String s containing the legal values for the
attribute.Adds a new attribute to a previously defined element that will be defined by a set of enumerated values. |
protected void | addAttribute(String
the name of the element. elementName, String the name of the attribute being added. attrName, int the data type (string format) of the attribute,
one of the dataType, boolean DATATYPE_* constants.true if the attribute must be present.the default value for the attribute, or
defaultValue, String null .the smallest (inclusive or exclusive depending
on the value of minValue, String minInclusive ) legal value for the
attribute, as a String .the largest (inclusive or exclusive depending
on the value of maxValue, boolean minInclusive ) legal value for the
attribute, as a String .true if minValue
is inclusive.true if maxValue
is inclusive.Adds a new attribute to a previously defined element that will be defined by a range of values. |
protected void | addAttribute(String
the name of the element. elementName, String the name of the attribute being added. attrName, int the data type (string format) of the attribute,
one of the dataType, boolean DATATYPE_* constants.true if the attribute must be present.the smallest legal number of list items. listMinLength, int the largest legal number of list items. listMaxLength)Adds a new attribute to a previously defined element that will be defined by a list of values. |
protected void | addBooleanAttribute(String
the name of the element. elementName, String the name of the attribute being added. attrName, boolean true if a default value
should be present.the default value for the attribute as a
defaultValue)boolean , ignored if hasDefaultValue
is false .Adds a new attribute to a previously defined element that will
be defined by the enumerated values |
protected void | addChildElement(String
the name of the element to be added as a
child. elementName, String the name of the element that will be the
new parent of the element. parentName)Adds an existing element to the list of legal children for a given parent node type. |
protected void | addElement(String
the name of the new element. elementName, String the name of the element that will be the
parent of the new element. parentName, int one of the childPolicy)CHILD_POLICY_*
constants, other than CHILD_POLICY_REPEAT ,
indicating the child policy of the new element.Adds a new element type to this metadata document format with a
child policy other than |
protected void | addElement(String
the name of the new element. elementName, String the name of the element that will be the
parent of the new element. parentName, int the minimum number of children of the node. minChildren, int the maximum number of children of the node. maxChildren)Adds a new element type to this metadata document format with a
child policy of |
protected < the type of the object. T> void | addObjectValue(String
the name of the element. elementName, Class<T> a classType, boolean Class variable indicating the
legal class type for the object value.true if an object value must be present.the default value for the
defaultValue)Object reference, or null .Allows an |
protected < the type of the object. T> void | addObjectValue(String
the name of the element. elementName, Class<T> a classType, boolean Class variable indicating the
legal class type for the object value.true if an object value must be present.the default value for the
defaultValue, List<? extends T> Object reference, or null .a enumeratedValues)List of
Object s containing the legal values for the
object reference.Allows an |
protected < the type of the object. T extends Comparable | addObjectValue(String
the name of the element. elementName, Class<T> a classType, T Class variable indicating the
legal class type for the object value.the default value for the defaultValue, Comparable<? super T> the smallest (inclusive or exclusive depending
on the value of minValue, Comparable<? super T> minInclusive ) legal value for the
object value, as a String .the largest (inclusive or exclusive depending
on the value of maxValue, boolean minInclusive ) legal value for the
object value, as a String .true if minValue
is inclusive.true if maxValue
is inclusive.Allows an |
protected void | addObjectValue(String
the name of the element. elementName, Class<?> a classType, int Class variable indicating the
legal class type for the object value.the smallest legal length for the array. arrayMinLength, int the largest legal length for the array. arrayMaxLength)Allows an |
public abstract boolean | canNodeAppear(String
the name of the element being queried. elementName, ImageTypeSpecifier an imageType)ImageTypeSpecifier indicating
the type of the image that will be associated with the
metadata.Redeclares javax. Returns |
private static synchronized void | |
private IIOMetadataFormatImpl. | |
public int | getAttributeDataType(String
the name of the element being queried. elementName, String the name of the attribute being queried. attrName)Implements javax. Returns one of the constants starting with
|
public String | getAttributeDefaultValue(String
the name of the element being queried. elementName, String the name of the attribute being queried. attrName)Implements javax. Returns the default value of the named attribute, if it is not
explicitly present within the named element, as a
|
public String | Returns: the attribute description.the name of the element. elementName, String the name of the attribute. attrName, Locale the locale)Locale for which localization
will be attempted, or null .Implements javax. Returns a |
public String[] | getAttributeEnumerations(String
the name of the element being queried. elementName, String the name of the attribute being queried. attrName)Implements javax. Returns an array of |
public int | getAttributeListMaxLength(String
the name of the element being queried. elementName, String the name of the attribute being queried. attrName)Implements javax. Returns the maximum number of list items that may be used to define this attribute. |
public int | getAttributeListMinLength(String
the name of the element being queried. elementName, String the name of the attribute being queried. attrName)Implements javax. Returns the minimum number of list items that may be used to define this attribute. |
public String | getAttributeMaxValue(String
the name of the element being queried, as a
elementName, String String .the name of the attribute being queried. attrName)Implements javax. Returns the maximum legal value for the attribute. |
public String | getAttributeMinValue(String
the name of the element being queried. elementName, String the name of the attribute being queried. attrName)Implements javax. Returns the minimum legal value for the attribute. |
public String[] | getAttributeNames(String
the name of the element being queried. elementName)Implements javax. Returns an array of |
public int | getAttributeValueType(String
the name of the element being queried. elementName, String the name of the attribute being queried. attrName)Implements javax. Returns one of the constants starting with |
public String[] | getChildNames(String
the name of the element being queried. elementName)Implements javax. Returns an array of |
public int | getChildPolicy(String
the name of the element being queried. elementName)Implements javax. Returns one of the constants starting with
|
private IIOMetadataFormatImpl. | getElement(String elementName, boolean
if mustAppear)true , throw an
IllegalArgumentException if no such node exists;
if false , just return null.Utility method for locating an element. |
private IIOMetadataFormatImpl. | |
public String | Returns: the element description.the name of the element. elementName, Locale the locale)Locale for which localization
will be attempted.Implements javax. Returns a |
public int | getElementMaxChildren(String
the name of the element being queried. elementName)Implements javax. Returns the maximum number of children of the named element
with child policy |
public int | getElementMinChildren(String
the name of the element being queried. elementName)Implements javax. Returns the minimum number of children of the named element
with child policy |
public int | getObjectArrayMaxLength(String
the name of the element being queried. elementName)Implements javax. Returns the maximum number of array elements that may be used
to define the |
public int | getObjectArrayMinLength(String
the name of the element being queried. elementName)Implements javax. Returns the minimum number of array elements that may be used
to define the |
public Class | getObjectClass(String
the name of the element being queried. elementName)Implements javax. Returns the |
public Object | getObjectDefaultValue(String
the name of the element being queried. elementName)Implements javax. Returns an |
public Object[] | getObjectEnumerations(String
the name of the element being queried. elementName)Implements javax. Returns an array of |
public Comparable | getObjectMaxValue(String
the name of the element being queried. elementName)Implements javax. Returns the maximum legal value for the |
public Comparable | getObjectMinValue(String
the name of the element being queried. elementName)Implements javax. Returns the minimum legal value for the |
private IIOMetadataFormatImpl. | |
public int | getObjectValueType(String
the name of the element being queried. elementName)Implements javax. Returns one of the enumerated values starting with
|
private String | |
protected String | Returns: aString containing the base name.Returns the currently set base name for locating
|
public String | getRootName()
Implements javax. Returns the name of the root element of the format. |
public static IIOMetadataFormat | Returns: a predefinedIIOMetadataFormat instance.Returns an |
public boolean | isAttributeRequired(String
the name of the element being queried. elementName, String the name of the attribute being queried. attrName)Implements javax. Returns |
protected void | removeAttribute(String
the name of the element. elementName, String the name of the attribute being removed. attrName)Removes an attribute from a previously defined element. |
protected void | removeElement(String
the name of the element to be removed. elementName)Removes an element from the format. |
protected void | removeObjectValue(String
the name of the element. elementName)Disallows an |
protected void | setResourceBaseName(String
a resourceBaseName)String containing the new
base name.Sets a new base name for locating |