org.apache.xmpbox.type

## Class TypeMapping

- java.lang.Object
- - org.apache.xmpbox.type.TypeMapping

    public final class TypeMapping
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`TypeMapping(XMPMetadata metadata)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`void` `addNewNameSpace(String ns, String preferred)`
`void` `addToDefinedStructuredTypes(String typeName, String ns, PropertiesDescription pm)`
`AgentNameType` `createAgentName(String namespaceURI, String prefix, String propertyName, String value)`
`ArrayProperty` `createArrayProperty(String namespace, String prefix, String propertyName, Cardinality type)`
`BooleanType` `createBoolean(String namespaceURI, String prefix, String propertyName, boolean value)`
`ChoiceType` `createChoice(String namespaceURI, String prefix, String propertyName, String value)`
`DateType` `createDate(String namespaceURI, String prefix, String propertyName, Calendar value)`
`GUIDType` `createGUID(String namespaceURI, String prefix, String propertyName, String value)`
`IntegerType` `createInteger(String namespaceURI, String prefix, String propertyName, int value)`
`LocaleType` `createLocale(String namespaceURI, String prefix, String propertyName, String value)`
`MIMEType` `createMIMEType(String namespaceURI, String prefix, String propertyName, String value)`
`PartType` `createPart(String namespaceURI, String prefix, String propertyName, String value)`
`ProperNameType` `createProperName(String namespaceURI, String prefix, String propertyName, String value)`
`static PropertyType` `createPropertyType(Types type, Cardinality card)`
`RealType` `createReal(String namespaceURI, String prefix, String propertyName, float value)`
`RenditionClassType` `createRenditionClass(String namespaceURI, String prefix, String propertyName, String value)`
`TextType` `createText(String namespaceURI, String prefix, String propertyName, String value)`
`URIType` `createURI(String namespaceURI, String prefix, String propertyName, String value)`
`URLType` `createURL(String namespaceURI, String prefix, String propertyName, String value)`
`XPathType` `createXPath(String namespaceURI, String prefix, String propertyName, String value)`
`XMPSchema` `getAssociatedSchemaObject(XMPMetadata metadata, String namespace, String prefix)` Deprecated. This method will be removed in 4.0. If you need it, let us know.
`PropertiesDescription` `getDefinedDescriptionByNamespace(String namespace)` Deprecated.
`PropertiesDescription` `getDefinedDescriptionByNamespace(String namespace, String pdfaFieldName)` Get a property description based on namespace and field name.
`XMPSchemaFactory` `getSchemaFactory(String namespace)`
`PropertyType` `getSpecifiedPropertyType(QName qName)` Deprecated.
`PropertyType` `getSpecifiedPropertyType(QName qName, String parentTypeName)` Give type of specified property in specified schema (given by its namespaceURI)
`PropertiesDescription` `getStructuredPropMapping(Types type)`
`PropertiesDescription` `initializePropMapping(Class<?> classSchem)`
`AbstractStructuredType` `instanciateDefinedType(String propertyName, String namespace)`
`AbstractSimpleProperty` `instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value)`
`AbstractSimpleProperty` `instanciateSimpleProperty(String nsuri, String prefix, String name, Object value, Types type)`
`AbstractStructuredType` `instanciateStructuredType(Types type, String propertyName)`
`boolean` `isDefinedNamespace(String namespace)`
`boolean` `isDefinedSchema(String namespace)` Say if a specific namespace is known
`boolean` `isDefinedType(String name)`
`boolean` `isDefinedTypeNamespace(String namespace)`
`boolean` `isStructuredTypeNamespace(String namespace)` Check if a namespace used reference a complex basic types (like Thumbnails)

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TypeMapping

    public TypeMapping(XMPMetadata metadata)

### Method Detail

#### addToDefinedStructuredTypes

    public void addToDefinedStructuredTypes(String typeName,
                                            String ns,
                                            PropertiesDescription pm)

#### getDefinedDescriptionByNamespace

    @Deprecated
    public PropertiesDescription getDefinedDescriptionByNamespace(String namespace)

Deprecated.

#### getDefinedDescriptionByNamespace

    public PropertiesDescription getDefinedDescriptionByNamespace(String namespace,
                                                                  String pdfaFieldName)

Get a property description based on namespace and field name. Both are needed because there can be several property descriptions for one namespace.

Parameters:
  `namespace` -
  `pdfaFieldName` -
Returns:

#### instanciateStructuredType

    public AbstractStructuredType instanciateStructuredType(Types type,
                                                            String propertyName)
                                                     throws BadFieldValueException

Throws:
  `BadFieldValueException`

#### instanciateDefinedType

    public AbstractStructuredType instanciateDefinedType(String propertyName,
                                                         String namespace)

#### instanciateSimpleProperty

    public AbstractSimpleProperty instanciateSimpleProperty(String nsuri,
                                                            String prefix,
                                                            String name,
                                                            Object value,
                                                            Types type)

#### instanciateSimpleField

    public AbstractSimpleProperty instanciateSimpleField(Class<?> clz,
                                                         String nsuri,
                                                         String prefix,
                                                         String propertyName,
                                                         Object value)

#### isStructuredTypeNamespace

    public boolean isStructuredTypeNamespace(String namespace)

Check if a namespace used reference a complex basic types (like Thumbnails)

Parameters:
  `namespace` - The namespace URI to check
Returns:
  True if namespace URI is a reference for a complex basic type

#### isDefinedTypeNamespace

    public boolean isDefinedTypeNamespace(String namespace)

#### isDefinedType

    public boolean isDefinedType(String name)

#### addNewNameSpace

    public void addNewNameSpace(String ns,
                                String preferred)

#### getStructuredPropMapping

    public PropertiesDescription getStructuredPropMapping(Types type)

#### getAssociatedSchemaObject

    @Deprecated
    public XMPSchema getAssociatedSchemaObject(XMPMetadata metadata,
                                                           String namespace,
                                                           String prefix)
                                                    throws XmpSchemaException

Deprecated. This method will be removed in 4.0. If you need it, let us know.
Return the specialized schema class representation if it's known (create and add it to metadata). In other cases, return null

Parameters:
  `metadata` - Metadata to link the new schema
  `namespace` - The namespace URI
  `prefix` - The namespace prefix
Returns:
  Schema representation
Throws:
  `XmpSchemaException` - When Instancing specified Object Schema failed

#### getSchemaFactory

    public XMPSchemaFactory getSchemaFactory(String namespace)

#### isDefinedSchema

    public boolean isDefinedSchema(String namespace)

Say if a specific namespace is known

Parameters:
  `namespace` - The namespace URI checked
Returns:
  True if namespace URI is known

#### isDefinedNamespace

    public boolean isDefinedNamespace(String namespace)

#### getSpecifiedPropertyType

    @Deprecated
    public PropertyType getSpecifiedPropertyType(QName qName)
                                                      throws BadFieldValueException

Deprecated.

Throws:
  `BadFieldValueException`

#### getSpecifiedPropertyType

    public PropertyType getSpecifiedPropertyType(QName qName,
                                                 String parentTypeName)
                                          throws BadFieldValueException

Give type of specified property in specified schema (given by its namespaceURI)

Parameters:
  `qName` - the property Qualified Name
  `parentTypeName` - the type name of the parent, or null if not known. This is intended to help when the field name is in several types, e.g. "Values" in exif.
Returns:
  Property type declared for namespace specified, null if unknown
Throws:
  `BadFieldValueException` - if the name of a type was not found.

#### initializePropMapping

    public PropertiesDescription initializePropMapping(Class<?> classSchem)

#### createBoolean

    public BooleanType createBoolean(String namespaceURI,
                                     String prefix,
                                     String propertyName,
                                     boolean value)

#### createDate

    public DateType createDate(String namespaceURI,
                               String prefix,
                               String propertyName,
                               Calendar value)

#### createInteger

    public IntegerType createInteger(String namespaceURI,
                                     String prefix,
                                     String propertyName,
                                     int value)

#### createReal

    public RealType createReal(String namespaceURI,
                               String prefix,
                               String propertyName,
                               float value)

#### createText

    public TextType createText(String namespaceURI,
                               String prefix,
                               String propertyName,
                               String value)

#### createProperName

    public ProperNameType createProperName(String namespaceURI,
                                           String prefix,
                                           String propertyName,
                                           String value)

#### createURI

    public URIType createURI(String namespaceURI,
                             String prefix,
                             String propertyName,
                             String value)

#### createURL

    public URLType createURL(String namespaceURI,
                             String prefix,
                             String propertyName,
                             String value)

#### createRenditionClass

    public RenditionClassType createRenditionClass(String namespaceURI,
                                                   String prefix,
                                                   String propertyName,
                                                   String value)

#### createPart

    public PartType createPart(String namespaceURI,
                               String prefix,
                               String propertyName,
                               String value)

#### createMIMEType

    public MIMEType createMIMEType(String namespaceURI,
                                   String prefix,
                                   String propertyName,
                                   String value)

#### createLocale

    public LocaleType createLocale(String namespaceURI,
                                   String prefix,
                                   String propertyName,
                                   String value)

#### createGUID

    public GUIDType createGUID(String namespaceURI,
                               String prefix,
                               String propertyName,
                               String value)

#### createChoice

    public ChoiceType createChoice(String namespaceURI,
                                   String prefix,
                                   String propertyName,
                                   String value)

#### createAgentName

    public AgentNameType createAgentName(String namespaceURI,
                                         String prefix,
                                         String propertyName,
                                         String value)

#### createXPath

    public XPathType createXPath(String namespaceURI,
                                 String prefix,
                                 String propertyName,
                                 String value)

#### createArrayProperty

    public ArrayProperty createArrayProperty(String namespace,
                                             String prefix,
                                             String propertyName,
                                             Cardinality type)

#### createPropertyType

    public static PropertyType createPropertyType(Types type,
                                                  Cardinality card)