4949import org .apache .xmpbox .schema .XMPRightsManagementSchema ;
5050import org .apache .xmpbox .schema .XMPSchema ;
5151import org .apache .xmpbox .schema .XMPSchemaFactory ;
52- import org .apache .xmpbox .schema .XmpSchemaException ;
5352
5453public final class TypeMapping
5554{
5655
5756 // type -> property
5857 private Map <Types , PropertiesDescription > structuredMappings ;
5958
60- // ns -> type
61- // filled during init
62- @ Deprecated
63- private Map <String , Types > structuredNamespaces ;
64-
65- // ns -> typeName
66- @ Deprecated
67- private Map <String , String > definedStructuredNamespaces ;
68-
6959 // ns -> list of property descriptions
7060 private Map <String , List <PropertiesDescription >> definedStructuredNamespaces2 ;
7161
@@ -93,7 +83,6 @@ private void initialize()
9383 {
9484 // structured types
9585 structuredMappings = new EnumMap <>(Types .class );
96- structuredNamespaces = new HashMap <>();
9786 structuredNamespaces2 = new HashMap <>();
9887 for (Types type : Types .values ())
9988 {
@@ -104,7 +93,6 @@ private void initialize()
10493 StructuredType st = clz .getAnnotation (StructuredType .class );
10594 String ns = st .namespace ();
10695 PropertiesDescription pm = initializePropMapping (clz );
107- structuredNamespaces .put (ns , type );
10896 List <Types > list = structuredNamespaces2 .get (ns );
10997 if (list != null )
11098 {
@@ -121,7 +109,6 @@ private void initialize()
121109 }
122110
123111 // define structured types
124- definedStructuredNamespaces = new HashMap <>();
125112 definedStructuredMappings = new HashMap <>();
126113 definedStructuredNamespaces2 = new HashMap <>();
127114
@@ -154,17 +141,9 @@ public void addToDefinedStructuredTypes(String typeName, String ns, PropertiesDe
154141 list .add (pm );
155142 definedStructuredNamespaces2 .put (ns , list );
156143 }
157- definedStructuredNamespaces .put (ns , typeName );
158144 definedStructuredMappings .put (typeName , pm );
159145 }
160146
161- @ Deprecated
162- public PropertiesDescription getDefinedDescriptionByNamespace (String namespace )
163- {
164- String dt = definedStructuredNamespaces .get (namespace );
165- return definedStructuredMappings .get (dt );
166- }
167-
168147 /**
169148 * Get a property description based on namespace and field name. Both are needed because there
170149 * can be several property descriptions for one namespace.
@@ -283,37 +262,6 @@ public PropertiesDescription getStructuredPropMapping(Types type)
283262 return structuredMappings .get (type );
284263 }
285264
286- /**
287- * Return the specialized schema class representation if it's known (create and add it to metadata). In other cases,
288- * return null
289- *
290- * @param metadata
291- * Metadata to link the new schema
292- * @param namespace
293- * The namespace URI
294- * @param prefix The namespace prefix
295- * @return Schema representation
296- * @throws XmpSchemaException
297- * When Instancing specified Object Schema failed
298- *
299- * @deprecated This method will be removed in 4.0. If you need it, let us know.
300- */
301- @ Deprecated
302- public XMPSchema getAssociatedSchemaObject (XMPMetadata metadata , String namespace , String prefix )
303- throws XmpSchemaException
304- {
305- if (schemaMap .containsKey (namespace ))
306- {
307- XMPSchemaFactory factory = schemaMap .get (namespace );
308- return factory .createXMPSchema (metadata , prefix );
309- }
310- else
311- {
312- XMPSchemaFactory factory = getSchemaFactory (namespace );
313- return factory != null ? factory .createXMPSchema (metadata , prefix ) : null ;
314- }
315- }
316-
317265 public XMPSchemaFactory getSchemaFactory (String namespace )
318266 {
319267 return schemaMap .get (namespace );
0 commit comments