|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SchemaAwareRepository
A repository that manages XSD (or similar) schemas by maintaining a mapping of namespace names to schema instances such that a client can determine what schema document is to be used for a given namespace. Note that these methods are fairly simplistic in that they assume a one-to-one mapping between namespaces and schema docs. In practice, there may be several schema instances that can be used for a given namespace under different circumstances. This suggests that the getSchema methods need to take an optional "discriminator" parameter that lets the repository decide among multiple possible schemas. Since this discrimination is likely to be speicfic to local business rules, this would be an extension point to be handled by specializations, either of SchemaAwareRepository or of some as-yet-defined "SchemaSelector" class (which maybe would be best implemented as a dependency link between versions representing the namespaces themselves and specific schema instances. Hmmm.
Method Summary | |
---|---|
Resource |
getSchemaResource(java.lang.String schemaUri)
Returns the resource of the specified schema. |
boolean |
hasSchema(java.lang.String schemaUri)
Returns true if the specified schema URI has been registered. |
void |
registerSchema(java.lang.String namespaceUri,
Resource schema)
Registers a schema URI and its location. |
Method Detail |
---|
void registerSchema(java.lang.String namespaceUri, Resource schema)
namespaceUri
- The URI (namespace name) of the schema, that is, the namespace that this
schema governs.schema
- The repository resource for the schema as it exists within the repository.boolean hasSchema(java.lang.String schemaUri)
schemaUri
- The URI (namespace name) of the schema.
Resource getSchemaResource(java.lang.String schemaUri)
schemaUri
- The schema to get.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |