Package org.apache.xmpbox.type
Class TypeMapping
java.lang.Object
org.apache.xmpbox.type.TypeMapping
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String,
PropertiesDescription> private final XMPMetadata
private Map<String,
XMPSchemaFactory> private static final Class<?>[]
private Map<Types,
PropertiesDescription> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addNameSpace
(Class<? extends XMPSchema> classSchem) void
addNewNameSpace
(String ns, String preferred) void
addToDefinedStructuredTypes
(String typeName, String ns, PropertiesDescription pm) createAgentName
(String namespaceURI, String prefix, String propertyName, String value) createArrayProperty
(String namespace, String prefix, String propertyName, Cardinality type) createBoolean
(String namespaceURI, String prefix, String propertyName, boolean value) createChoice
(String namespaceURI, String prefix, String propertyName, String value) createDate
(String namespaceURI, String prefix, String propertyName, Calendar value) createGUID
(String namespaceURI, String prefix, String propertyName, String value) createInteger
(String namespaceURI, String prefix, String propertyName, int value) createLocale
(String namespaceURI, String prefix, String propertyName, String value) createMIMEType
(String namespaceURI, String prefix, String propertyName, String value) createPart
(String namespaceURI, String prefix, String propertyName, String value) createProperName
(String namespaceURI, String prefix, String propertyName, String value) static PropertyType
createPropertyType
(Types type, Cardinality card) createReal
(String namespaceURI, String prefix, String propertyName, float value) createRenditionClass
(String namespaceURI, String prefix, String propertyName, String value) createText
(String namespaceURI, String prefix, String propertyName, String value) createXPath
(String namespaceURI, String prefix, String propertyName, String value) getAssociatedSchemaObject
(XMPMetadata metadata, String namespace, String prefix) Return the specialized schema class representation if it's known (create and add it to metadata).getDefinedDescriptionByNamespace
(String namespace) getSchemaFactory
(String namespace) Give type of specified property in specified schema (given by its namespaceURI)private void
initializePropMapping
(Class<?> classSchem) instanciateDefinedType
(String propertyName, String namespace) instanciateSimpleField
(Class<?> clz, String nsuri, String prefix, String propertyName, Object value) instanciateStructuredType
(Types type, String propertyName) boolean
isDefinedNamespace
(String namespace) boolean
isDefinedSchema
(String namespace) Say if a specific namespace is knownboolean
isDefinedType
(String name) boolean
isDefinedTypeNamespace
(String namespace) boolean
isStructuredTypeNamespace
(String namespace) Check if a namespace used reference a complex basic types (like Thumbnails)
-
Field Details
-
structuredMappings
-
structuredNamespaces
-
definedStructuredNamespaces
-
definedStructuredMappings
-
metadata
-
schemaMap
-
SIMPLEPROPERTYCONSTPARAMS
-
-
Constructor Details
-
TypeMapping
-
-
Method Details
-
initialize
private void initialize() -
addToDefinedStructuredTypes
-
getDefinedDescriptionByNamespace
-
instanciateStructuredType
public AbstractStructuredType instanciateStructuredType(Types type, String propertyName) throws BadFieldValueException - Throws:
BadFieldValueException
-
instanciateDefinedType
-
instanciateSimpleProperty
-
instanciateSimpleField
-
isStructuredTypeNamespace
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
-
isDefinedType
-
addNameSpace
-
addNewNameSpace
-
getStructuredPropMapping
-
getAssociatedSchemaObject
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
- Metadata to link the new schemanamespace
- The namespace URIprefix
- The namespace prefix- Returns:
- Schema representation
- Throws:
XmpSchemaException
- When Instancing specified Object Schema failed
-
getSchemaFactory
-
isDefinedSchema
Say if a specific namespace is known- Parameters:
namespace
- The namespace URI checked- Returns:
- True if namespace URI is known
-
isDefinedNamespace
-
getSpecifiedPropertyType
Give type of specified property in specified schema (given by its namespaceURI)- Parameters:
name
- the property Qualified Name- Returns:
- Property type declared for namespace specified, null if unknown
- Throws:
BadFieldValueException
- if the name was not found.
-
initializePropMapping
-
createBoolean
public BooleanType createBoolean(String namespaceURI, String prefix, String propertyName, boolean value) -
createDate
-
createInteger
public IntegerType createInteger(String namespaceURI, String prefix, String propertyName, int value) -
createReal
-
createText
-
createProperName
public ProperNameType createProperName(String namespaceURI, String prefix, String propertyName, String value) -
createURI
-
createURL
-
createRenditionClass
public RenditionClassType createRenditionClass(String namespaceURI, String prefix, String propertyName, String value) -
createPart
-
createMIMEType
-
createLocale
public LocaleType createLocale(String namespaceURI, String prefix, String propertyName, String value) -
createGUID
-
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
-
createArrayProperty
public ArrayProperty createArrayProperty(String namespace, String prefix, String propertyName, Cardinality type) -
createPropertyType
-