com.android.repository.api
Class SchemaModule

java.lang.Object
  extended by com.android.repository.api.SchemaModule

public class SchemaModule
extends java.lang.Object

Represents a versioned set of generated classes corresponding to a versioned XML schema. This can be a single stand-alone schema, or an extension to an existing schema. For example, repo-common-N.xsd defines a schema for a repository with packages, and the collection of the schemas for all N would be represented by a single SchemaModule instance. They can then be used for marshalling or unmarshalling XML documents by the repository framework.


Nested Class Summary
 class SchemaModule.SchemaModuleVersion
          Represents a single version of a schema, including a single XSD and a single ObjectFactory.
 
Constructor Summary
SchemaModule(java.lang.String ofPattern, java.lang.String xsdPattern, java.lang.Class resourceRoot)
           
 
Method Summary
 java.lang.Object createLatestFactory()
          Creates an ObjectFactory for the latest known version of this module.
 java.util.Map<java.lang.String,SchemaModule.SchemaModuleVersion> getNamespaceVersionMap()
          Gets the map of namespaces to SchemaModule.SchemaModuleVersions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaModule

public SchemaModule(@NonNull
                    java.lang.String ofPattern,
                    @NonNull
                    java.lang.String xsdPattern,
                    @NonNull
                    java.lang.Class resourceRoot)
             throws java.net.URISyntaxException,
                    java.lang.InstantiationException
Parameters:
ofPattern - Fully-qualified class name of the JAXB ObjectFactory classes making up this module. Should have a single %d parameter, corresponding to the 1-indexed version of the schema.
xsdPattern - Filename pattern of the XSDs making up this module. Should have a single %d parameter, corresponding to the 1-indexed version of the schema.
resourceRoot - A class instance used via Class.getResource(String) to read the XSD file.
Throws:
java.net.URISyntaxException - If the given XSD file isn't valid.
java.lang.InstantiationException - If the ObjectFactory can't be created, or if no versions are found.
Method Detail

createLatestFactory

@NonNull
public java.lang.Object createLatestFactory()
Creates an ObjectFactory for the latest known version of this module.


getNamespaceVersionMap

@NonNull
public java.util.Map<java.lang.String,SchemaModule.SchemaModuleVersion> getNamespaceVersionMap()
Gets the map of namespaces to SchemaModule.SchemaModuleVersions. Should only be needed by the repository framework.