|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver
public class DefaultSchemaResolver
A default SchemaBindingResolver that uses a JBossEntityResolver to locate the schema xsd.
| Constructor Summary | |
|---|---|
DefaultSchemaResolver()
|
|
DefaultSchemaResolver(org.jboss.util.xml.JBossEntityResolver resolver)
|
|
| Method Summary | |
|---|---|
void |
addClassBinding(String nsUri,
Class<?> clazz)
|
void |
addClassBinding(String nsUri,
String reference)
Add an in-memory schema. |
void |
addClassBindingForLocation(String schemaLocation,
Class<?> clazz)
|
void |
addSchemaInitializer(String nsUri,
SchemaBindingInitializer sbi)
Registers an instance of SchemaBindingInitializer for the namespace URI. |
void |
addSchemaInitializer(String nsUri,
String sbiClassName)
Registers a SchemaBindingInitializer for the namespace URI. |
void |
addSchemaLocation(String nsUri,
String location)
Registers a location for the namespace URI. |
void |
addSchemaParseAnnotations(String nsUri,
Boolean value)
Whether to parse annotations for this namespace. |
String |
getBaseURI()
|
boolean |
isCacheResolvedSchemas()
|
Class<?> |
removeClassBinding(String nsUri)
|
Class<?> |
removeClassBindingForLocation(String schemaLocation)
|
SchemaBindingInitializer |
removeSchemaInitializer(String nsUri)
Unregisters and returns the SchemaBindingInitializer for the namespace URI. |
void |
removeSchemaLocation(String nsUri)
Removes a location for the namespace URI. |
Boolean |
removeSchemaParseAnnotations(String nsUri)
Removes the parse annotation configuration for this namespace |
SchemaBinding |
resolve(String nsURI,
String baseURI,
String schemaLocation)
Uses the JBossEntityResolver.resolveEntity by: 1. |
LSInput |
resolveAsLSInput(String nsURI,
String baseURI,
String schemaLocation)
This one is used to resolve imported schemas with |
protected Class<?> |
resolveClassFromSchemaLocation(String schemaLocation,
boolean trace)
Lookup a binding class by schemaLocation. |
void |
setBaseURI(String baseURI)
|
void |
setCacheResolvedSchemas(boolean cacheResolvedSchemas)
Passing in true will make the schema resolver to cache successfully resolved schemas (which is the default) with namespace URI being the identifier of a schema. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultSchemaResolver()
public DefaultSchemaResolver(org.jboss.util.xml.JBossEntityResolver resolver)
| Method Detail |
|---|
public boolean isCacheResolvedSchemas()
public void setCacheResolvedSchemas(boolean cacheResolvedSchemas)
cacheResolvedSchemas -
public void addSchemaLocation(String nsUri,
String location)
This location is looked using the JBossEntityResolver, i.e. it is a classpath location
nsUri - the namespace locationlocation - the classpath locationpublic void removeSchemaLocation(String nsUri)
nsUri - the namespace location
public void addSchemaParseAnnotations(String nsUri,
Boolean value)
nsUri - the namespacevalue - the value of the optionpublic Boolean removeSchemaParseAnnotations(String nsUri)
nsUri - the namespace
public void addSchemaInitializer(String nsUri,
String sbiClassName)
throws Exception
nsUri - the namespace URI to register the schema initializer forsbiClassName - the class name SchemaBindingInitializer
Exception - for any error
public void addSchemaInitializer(String nsUri,
SchemaBindingInitializer sbi)
nsUri - the namespace URI to register the schema initializer forsbi - an instance of SchemaBindingInitializerpublic SchemaBindingInitializer removeSchemaInitializer(String nsUri)
nsUri - the namespace URI to unregister SchemaBindingInitializer for
public void addClassBinding(String nsUri,
String reference)
throws Exception
nsUri - schema namespacereference - the schema reference class name
Exception - for any error
public void addClassBinding(String nsUri,
Class<?> clazz)
public Class<?> removeClassBinding(String nsUri)
public void addClassBindingForLocation(String schemaLocation,
Class<?> clazz)
public Class<?> removeClassBindingForLocation(String schemaLocation)
public String getBaseURI()
getBaseURI in interface SchemaBindingResolverpublic void setBaseURI(String baseURI)
setBaseURI in interface SchemaBindingResolver
public SchemaBinding resolve(String nsURI,
String baseURI,
String schemaLocation)
resolve in interface SchemaBindingResolvernsURI - - namespace URI of the element with the schema referencebaseURI - - an optional baseURI for resolving the schemaLocation.schemaLocation - - the option schema location uri that matches
nsUri if one exists
protected Class<?> resolveClassFromSchemaLocation(String schemaLocation,
boolean trace)
schemaLocation - the schema location from the parsertrace - - logging trace flag
public LSInput resolveAsLSInput(String nsURI,
String baseURI,
String schemaLocation)
SchemaBindingResolver
resolveAsLSInput in interface SchemaBindingResolver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||