|
Novell exteNd Web Services SDK API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sssw.jbroker.web.encoding.DefaultTypeMappingRegistry
The DefaultTypeMappingRegistry
class is an implementation
of the standard TypeMappingRegistry
interface. It supports
additional utility methods for importing type mappings. The default type
mapper is an expert facility that will not be used by most applications.
Constructor Summary | |
DefaultTypeMappingRegistry()
Construct an empty type mapping registry. |
|
DefaultTypeMappingRegistry(TypeMapper mapper)
Construct a type mapping registry using a jBroker Web 1.1 type mapper. |
Method Summary | |
void |
clear()
Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry. |
TypeMapping |
createTypeMapping()
Creates a new empty TypeMapping object. |
TypeMapping |
createTypeMapping(String uri)
|
TypeMap |
get(Class javaType)
Get a type map for a Java class. |
TypeMap |
get(Class javaType,
QName xmlType)
Get a type map between Java class and XML type. |
TypeMap |
get(Class javaType,
String uri)
Get a type map for a Java class from a particular namespace. |
TypeMap |
get(Class javaType,
String typeNS,
String typeName)
Get a type map between Java class and XML type. |
TypeMap |
get(QName qname)
Get a type map for a QName. |
TypeMap |
get(QName qname)
Deprecated. use standard QName instead |
TypeMapping |
getDefaultTypeMapping()
Gets the registered default TypeMapping instance. |
String[] |
getRegisteredEncodingStyleURIs()
Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance. |
TypeMapping |
getTypeMapping(String encodingStyleURI)
Returns the registered TypeMapping for the specified
encodingStyle URI. |
void |
importTypeMappings(InputStream is,
ClassLoader loader)
Import type mappings from an input stream into this registry |
void |
importTypeMappings(Properties mappings)
Import type mappings from a property object |
void |
importTypeMappings(Properties mappings,
ClassLoader loader)
Import the mappings from the given properties. |
void |
importTypeMappings(String resourceName)
Import type mappings from a resource into this registry |
void |
importTypeMappings(String resourceName,
ClassLoader loader)
Import type mappings from a resource into this registry |
void |
importTypeMappings(String propResource,
Servlet servlet)
Import type mappings from property resource in servlet |
void |
importTypeMappings(String propResource,
Servlet servlet,
ClassLoader loader)
Import type mappings from property resource in servlet |
void |
importTypeMappingsFromFile(String fileName)
Import type mappings from a file into this registry |
void |
importTypeMappingsFromFile(String fileName,
ClassLoader loader)
Import type mappings from a file into this registry |
Iterator |
iterator()
Iterator for all the type maps in the registry. |
void |
put(TypeMap tm)
Put a type map into the registry. |
TypeMapping |
register(String encodingStyleURI,
TypeMapping tm)
Registers a TypeMapping instance with the
TypeMappingRegistry . |
void |
registerDefault(TypeMapping tm)
Registers the TypeMapping instance that is default
for all encoding styles supported by the
TypeMappingRegistry . |
boolean |
removeTypeMapping(TypeMapping tm)
Removes a TypeMapping from the TypeMappingRegistry. |
String |
toString()
Get a pretty printed string with type mappings in this registry |
TypeMapping |
unregisterTypeMapping(String encodingStyleURI)
Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DefaultTypeMappingRegistry()
public DefaultTypeMappingRegistry(TypeMapper mapper)
mapper
- a jBroker Web 1.1 type mapper objectMethod Detail |
public TypeMapping register(String encodingStyleURI, TypeMapping tm)
TypeMappingRegistry
TypeMapping
instance with the
TypeMappingRegistry
. This method replaces any
existing registered TypeMapping
instance for
the specified encodingStyleURI
.
register
in interface TypeMappingRegistry
encodingStyleURI
- An encoding style specified as an URI.
An example is "http://schemas.xmlsoap.org/soap/encoding/"tm
- TypeMapping instance
encodingStyleURI
, or null
if there was no TypeMapping associated with the specified
encodingStyleURI
public void registerDefault(TypeMapping tm)
TypeMappingRegistry
TypeMapping
instance that is default
for all encoding styles supported by the
TypeMappingRegistry
. A default TypeMapping
should include serializers and deserializers that are independent
of and usable with any encoding style. Successive invocations
of the registerDefault
method replace any existing
default TypeMapping
instance.
If the default TypeMapping
is registered, any
other TypeMapping instances registered through the
TypeMappingRegistry.register
method (for a set
of encodingStyle URIs) override the default TypeMapping
.
registerDefault
in interface TypeMappingRegistry
tm
- TypeMapping instancepublic TypeMapping getDefaultTypeMapping()
TypeMappingRegistry
TypeMapping
instance.
This method returns null
if there is no registered
default TypeMapping in the registry.
getDefaultTypeMapping
in interface TypeMappingRegistry
TypeMapping
instance
or null
public String[] getRegisteredEncodingStyleURIs()
TypeMappingRegistry
TypeMappingRegistry
instance.
getRegisteredEncodingStyleURIs
in interface TypeMappingRegistry
public TypeMapping getTypeMapping(String encodingStyleURI)
TypeMappingRegistry
TypeMapping
for the specified
encodingStyle URI. If there is no registered TypeMapping
for the specified encodingStyleURI
, this method
returns null
.
getTypeMapping
in interface TypeMappingRegistry
encodingStyleURI
- Encoding style specified as an URI
null
public TypeMapping createTypeMapping(String uri)
public TypeMapping createTypeMapping()
TypeMappingRegistry
TypeMapping
object.
createTypeMapping
in interface TypeMappingRegistry
public TypeMapping unregisterTypeMapping(String encodingStyleURI)
TypeMappingRegistry
unregisterTypeMapping
in interface TypeMappingRegistry
encodingStyleURI
- Encoding style specified as an URI
TypeMapping
instance that has been unregistered
or null
if there was no TypeMapping
registered for the specified encodingStyleURI
public boolean removeTypeMapping(TypeMapping tm)
TypeMappingRegistry
TypeMapping
from the TypeMappingRegistry. A
TypeMapping
is associated with 1 or more
encodingStyleURIs. This method unregisters the specified
TypeMapping
instance from all associated
encodingStyleURIs
and then removes this
TypeMapping instance from the registry.
removeTypeMapping
in interface TypeMappingRegistry
tm
- TypeMapping to be removed
true
if specified TypeMapping
is removed from the TypeMappingRegistry; false
if the specified TypeMapping
was not in the
TypeMappingRegistry
public void clear()
TypeMappingRegistry
clear
in interface TypeMappingRegistry
public TypeMap get(Class javaType)
javaType
- the Java type
TypeMap
object, or null if none foundpublic TypeMap get(Class javaType, QName xmlType)
javaType
- the Java typexmlType
- the QName of the Xml type.
TypeMap
object, or null if none foundpublic TypeMap get(Class javaType, String typeNS, String typeName)
javaType
- the Java typetypeNS
- the Namespace of the Xml type.typeName
- the Name of the Xml type.
TypeMap
object, or null if none foundpublic TypeMap get(Class javaType, String uri)
javaType
- the Java typeuri
- the namespace URI
TypeMap
object, or null if none foundpublic TypeMap get(QName qname)
qname
- the QName type
TypeMap
object, or null if none foundpublic TypeMap get(QName qname)
qname
- the QName type
TypeMap
object, or null if none foundpublic void put(TypeMap tm)
TypeMapping
will be determined from the namespace
URI of the type map's getQName
method.
tm
- a TypeMap
objectpublic Iterator iterator()
public void importTypeMappings(String resourceName) throws TypeMappingException, IOException
importTypeMappings
in interface TypeMappingRegistry
resourceName
- the resource name with type mapping entries
TypeMappingException
- if import failed
IOException
- if resource could not be readpublic void importTypeMappings(String resourceName, ClassLoader loader) throws TypeMappingException, IOException
importTypeMappings
in interface TypeMappingRegistry
resourceName
- the resource name with type mapping entriesloader
- class loader to load mapping classes
TypeMappingException
- if import failed
IOException
- if resource could not be readpublic void importTypeMappingsFromFile(String fileName) throws TypeMappingException, IOException
importTypeMappingsFromFile
in interface TypeMappingRegistry
fileName
- name of the file with type mapping entries
TypeMappingException
- if import failed
IOException
- if file could not be readpublic void importTypeMappingsFromFile(String fileName, ClassLoader loader) throws TypeMappingException, IOException
importTypeMappingsFromFile
in interface TypeMappingRegistry
fileName
- name of the file with type mapping entriesloader
- class loader to load mapping classes
TypeMappingException
- if import failed
IOException
- if file could not be readpublic void importTypeMappings(InputStream is, ClassLoader loader) throws IOException, TypeMappingException
importTypeMappings
in interface TypeMappingRegistry
loader
- class loader to load mapping classes
TypeMappingException
- if import failed
IOException
- if stream could not be readpublic void importTypeMappings(String propResource, Servlet servlet) throws TypeMappingException, ServletException, IOException
importTypeMappings
in interface TypeMappingRegistry
propResource
- name of the resource with type mapping entriesservlet
- the servlet object
TypeMappingException
- if import failed
ServletException
- if servlet context could not be retrieved
IOException
- if stream could not be readpublic void importTypeMappings(String propResource, Servlet servlet, ClassLoader loader) throws TypeMappingException, ServletException, IOException
importTypeMappings
in interface TypeMappingRegistry
propResource
- name of the resource with type mapping entriesservlet
- the servlet objectloader
- class loader to load mapping classes
TypeMappingException
- if import failed
ServletException
- if servlet context could not be retrieved
IOException
- if stream could not be readpublic void importTypeMappings(Properties mappings) throws TypeMappingException
importTypeMappings
in interface TypeMappingRegistry
mappings
- property set with mappings
TypeMappingException
- if import failedpublic void importTypeMappings(Properties mappings, ClassLoader loader) throws TypeMappingException
<java Type> <Serializer> <Deserializer> <URI> <LN> <location>For example,
mapping1=Address AddressMarshaler AddressMarshaler urn:DemoApp Address http://schemas.acme.org/addressThe java classes are loaded from the given class loader.
importTypeMappings
in interface TypeMappingRegistry
mappings
- property set with mappingsloader
- class loader to load mapping classes
TypeMappingException
- if import failedpublic String toString()
|
Novell exteNd Web Services SDK API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |