Top Description Fields Constructors Methods
org.apache.xmpbox.schema

public Class XMPSchemaFactory

extends Object
Class Inheritance
Imports
org.apache.xmpbox.XMPMetadata, org.apache.xmpbox.type.PropertiesDescription, .PropertyType

A factory for each kind of schemas
Author
a183132

Field Summary

Modifier and TypeField and Description
private final String
private final PropertiesDescription
private final Class<? extends XMPSchema>

Constructor Summary

AccessConstructor and Description
public
XMPSchemaFactory(String
namespace URI to treat
namespace
,
Class<? extends XMPSchema>
Class representation associated to this URI
schemaClass
,
PropertiesDescription
Properties Types list associated
propDef
)

Factory Constructor for basic known schemas

Method Summary

Modifier and TypeMethod and Description
public XMPSchema

Returns:

the schema created and added to metadata
createXMPSchema
(XMPMetadata
Metadata to attach the Schema created
metadata
,
String
The namespace prefix (optional)
prefix
)

Create a schema that corresponding to this factory and add it to metadata

public String

Returns:

The namespace URI
getNamespace
()

Get namespace URI treated by this factory

public PropertiesDescription
public PropertyType

Returns:

null if property name is unknown
getPropertyType
(String
The property name
name
)

Get type declared for the name property given

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

namespaceback to summary
private final String namespace
propDefback to summary
private final PropertiesDescription propDef
schemaClassback to summary
private final Class<? extends XMPSchema> schemaClass

Constructor Detail

XMPSchemaFactoryback to summary
public XMPSchemaFactory(String namespace, Class<? extends XMPSchema> schemaClass, PropertiesDescription propDef)

Factory Constructor for basic known schemas

Parameters
namespace:String

namespace URI to treat

schemaClass:Class<? extends XMPSchema>

Class representation associated to this URI

propDef:PropertiesDescription

Properties Types list associated

Method Detail

createXMPSchemaback to summary
public XMPSchema createXMPSchema(XMPMetadata metadata, String prefix) throws XmpSchemaException

Create a schema that corresponding to this factory and add it to metadata

Parameters
metadata:XMPMetadata

Metadata to attach the Schema created

prefix:String

The namespace prefix (optional)

Returns:XMPSchema

the schema created and added to metadata

Exceptions
XmpSchemaException:
When Instancing specified Object Schema failed
getNamespaceback to summary
public String getNamespace()

Get namespace URI treated by this factory

Returns:String

The namespace URI

getPropertyDefinitionback to summary
public PropertiesDescription getPropertyDefinition()
getPropertyTypeback to summary
public PropertyType getPropertyType(String name)

Get type declared for the name property given

Parameters
name:String

The property name

Returns:PropertyType

null if property name is unknown