Class TypeMapping
java.lang.Object
org.apache.xmpbox.type.TypeMapping
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNewNameSpace(String ns, String preferred) voidaddToDefinedStructuredTypes(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 PropertyTypecreatePropertyType(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) Deprecated.This method will be removed in 4.0.getDefinedDescriptionByNamespace(String namespace) Deprecated.getDefinedDescriptionByNamespace(String namespace, String pdfaFieldName) Get a property description based on namespace and field name.getSchemaFactory(String namespace) getSpecifiedPropertyType(QName qName) Deprecated.getSpecifiedPropertyType(QName qName, String parentTypeName) Give type of specified property in specified schema (given by its namespaceURI)initializePropMapping(Class<?> classSchem) instanciateDefinedType(String propertyName, String namespace) instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value) instanciateStructuredType(Types type, String propertyName) booleanisDefinedNamespace(String namespace) booleanisDefinedSchema(String namespace) Say if a specific namespace is knownbooleanisDefinedType(String name) booleanisDefinedTypeNamespace(String namespace) booleanisStructuredTypeNamespace(String namespace) Check if a namespace used reference a complex basic types (like Thumbnails)
-
Constructor Details
-
TypeMapping
-
-
Method Details
-
addToDefinedStructuredTypes
-
getDefinedDescriptionByNamespace
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
-
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
-
addNewNameSpace
-
getStructuredPropMapping
-
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 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
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 NameparentTypeName- 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
-
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
-