Top Fields Constructors Methods
org.apache.xmpbox.type

public final Class TypeMapping

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, java.lang.reflect.Constructor, .Field, .InvocationTargetException, java.util.Calendar, .EnumMap, .HashMap, .Map, javax.xml.namespace.QName, org.apache.xmpbox.XMPMetadata, org.apache.xmpbox.schema.AdobePDFSchema, .DublinCoreSchema, .ExifSchema, .PDFAExtensionSchema, .PDFAIdentificationSchema, .PhotoshopSchema, .TiffSchema, .XMPBasicJobTicketSchema, .XMPBasicSchema, .XMPMediaManagementSchema, .XMPRightsManagementSchema, .XMPSchema, .XMPSchemaFactory, .XMPageTextSchema, .XmpSchemaException

Field Summary

Modifier and TypeField and Description
private Map<String, PropertiesDescription>
private Map<String, String>
private final XMPMetadata
private Map<String, XMPSchemaFactory>
private static final Class<?>[]
private Map<Types, PropertiesDescription>
private Map<String, Types>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addNameSpace(Class<? extends XMPSchema> classSchem)

public void
addNewNameSpace(String ns, String preferred)

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

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

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

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

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

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

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

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

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

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

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

public static PropertyType
createPropertyType(final Types type, final Cardinality card)

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

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

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

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

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

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

public XMPSchema

Returns:

Schema representation
getAssociatedSchemaObject
(XMPMetadata
Metadata to link the new schema
metadata
,
String
The namespace URI
namespace
,
String
The namespace prefix
prefix
)

Return the specialized schema class representation if it's known (create and add it to metadata).

public PropertiesDescription
public XMPSchemaFactory
public PropertyType

Returns:

Property type declared for namespace specified, null if unknown
getSpecifiedPropertyType
(QName
the property Qualified Name
name
)

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

public PropertiesDescription
private void
public PropertiesDescription
public AbstractStructuredType
instanciateDefinedType(String propertyName, String namespace)

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

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

public AbstractStructuredType
public boolean
public boolean

Returns:

True if namespace URI is known
isDefinedSchema
(String
The namespace URI checked
namespace
)

Say if a specific namespace is known

public boolean
public boolean
public boolean

Returns:

True if namespace URI is a reference for a complex basic type
isStructuredTypeNamespace
(String
The namespace URI to check
namespace
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

definedStructuredMappingsback to summary
private Map<String, PropertiesDescription> definedStructuredMappings
definedStructuredNamespacesback to summary
private Map<String, String> definedStructuredNamespaces
metadataback to summary
private final XMPMetadata metadata
schemaMapback to summary
private Map<String, XMPSchemaFactory> schemaMap
SIMPLEPROPERTYCONSTPARAMSback to summary
private static final Class<?>[] SIMPLEPROPERTYCONSTPARAMS
structuredMappingsback to summary
private Map<Types, PropertiesDescription> structuredMappings
structuredNamespacesback to summary
private Map<String, Types> structuredNamespaces

Constructor Detail

TypeMappingback to summary
public TypeMapping(XMPMetadata metadata)

Method Detail

addNameSpaceback to summary
private void addNameSpace(Class<? extends XMPSchema> classSchem)
addNewNameSpaceback to summary
public void addNewNameSpace(String ns, String preferred)
addToDefinedStructuredTypesback to summary
public void addToDefinedStructuredTypes(String typeName, String ns, PropertiesDescription pm)
createAgentNameback to summary
public AgentNameType createAgentName(String namespaceURI, String prefix, String propertyName, String value)
createArrayPropertyback to summary
public ArrayProperty createArrayProperty(String namespace, String prefix, String propertyName, Cardinality type)
createBooleanback to summary
public BooleanType createBoolean(String namespaceURI, String prefix, String propertyName, boolean value)
createChoiceback to summary
public ChoiceType createChoice(String namespaceURI, String prefix, String propertyName, String value)
createDateback to summary
public DateType createDate(String namespaceURI, String prefix, String propertyName, Calendar value)
createGUIDback to summary
public GUIDType createGUID(String namespaceURI, String prefix, String propertyName, String value)
createIntegerback to summary
public IntegerType createInteger(String namespaceURI, String prefix, String propertyName, int value)
createLocaleback to summary
public LocaleType createLocale(String namespaceURI, String prefix, String propertyName, String value)
createMIMETypeback to summary
public MIMEType createMIMEType(String namespaceURI, String prefix, String propertyName, String value)
createPartback to summary
public PartType createPart(String namespaceURI, String prefix, String propertyName, String value)
createProperNameback to summary
public ProperNameType createProperName(String namespaceURI, String prefix, String propertyName, String value)
createPropertyTypeback to summary
public static PropertyType createPropertyType(final Types type, final Cardinality card)
createRealback to summary
public RealType createReal(String namespaceURI, String prefix, String propertyName, float value)
createRenditionClassback to summary
public RenditionClassType createRenditionClass(String namespaceURI, String prefix, String propertyName, String value)
createTextback to summary
public TextType createText(String namespaceURI, String prefix, String propertyName, String value)
createURIback to summary
public URIType createURI(String namespaceURI, String prefix, String propertyName, String value)
createURLback to summary
public URLType createURL(String namespaceURI, String prefix, String propertyName, String value)
createXPathback to summary
public XPathType createXPath(String namespaceURI, String prefix, String propertyName, String value)
getAssociatedSchemaObjectback to summary
public XMPSchema getAssociatedSchemaObject(XMPMetadata metadata, String namespace, String prefix) throws XmpSchemaException

Return the specialized schema class representation if it's known (create and add it to metadata). In other cases, return null

Parameters
metadata:XMPMetadata

Metadata to link the new schema

namespace:String

The namespace URI

prefix:String

The namespace prefix

Returns:XMPSchema

Schema representation

Exceptions
XmpSchemaException:
When Instancing specified Object Schema failed
getDefinedDescriptionByNamespaceback to summary
public PropertiesDescription getDefinedDescriptionByNamespace(String namespace)
getSchemaFactoryback to summary
public XMPSchemaFactory getSchemaFactory(String namespace)
getSpecifiedPropertyTypeback to summary
public PropertyType getSpecifiedPropertyType(QName name) throws BadFieldValueException

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

Parameters
name:QName

the property Qualified Name

Returns:PropertyType

Property type declared for namespace specified, null if unknown

Exceptions
BadFieldValueException:
if the name was not found.
getStructuredPropMappingback to summary
public PropertiesDescription getStructuredPropMapping(Types type)
initializeback to summary
private void initialize()
initializePropMappingback to summary
public PropertiesDescription initializePropMapping(Class<?> classSchem)
instanciateDefinedTypeback to summary
public AbstractStructuredType instanciateDefinedType(String propertyName, String namespace)
instanciateSimpleFieldback to summary
public AbstractSimpleProperty instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value)
instanciateSimplePropertyback to summary
public AbstractSimpleProperty instanciateSimpleProperty(String nsuri, String prefix, String name, Object value, Types type)
instanciateStructuredTypeback to summary
public AbstractStructuredType instanciateStructuredType(Types type, String propertyName) throws BadFieldValueException
isDefinedNamespaceback to summary
public boolean isDefinedNamespace(String namespace)
isDefinedSchemaback to summary
public boolean isDefinedSchema(String namespace)

Say if a specific namespace is known

Parameters
namespace:String

The namespace URI checked

Returns:boolean

True if namespace URI is known

isDefinedTypeback to summary
public boolean isDefinedType(String name)
isDefinedTypeNamespaceback to summary
public boolean isDefinedTypeNamespace(String namespace)
isStructuredTypeNamespaceback to summary
public boolean isStructuredTypeNamespace(String namespace)

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

Parameters
namespace:String

The namespace URI to check

Returns:boolean

True if namespace URI is a reference for a complex basic type