org.codehaus.xfire.java.mapping
Class DefaultTypeMappingRegistry

java.lang.Object
  |
  +--org.codehaus.plexus.logging.AbstractLogEnabled
        |
        +--org.codehaus.xfire.plexus.PlexusXFireComponent
              |
              +--org.codehaus.xfire.java.mapping.DefaultTypeMappingRegistry
All Implemented Interfaces:
org.codehaus.plexus.personality.plexus.lifecycle.phase.Configurable, org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.personality.plexus.lifecycle.phase.Serviceable, TypeMappingRegistry

public class DefaultTypeMappingRegistry
extends org.codehaus.xfire.plexus.PlexusXFireComponent
implements TypeMappingRegistry, org.codehaus.plexus.personality.plexus.lifecycle.phase.Configurable

The default implementation of TypeMappingRegistry.

Since:
Feb 22, 2004
Author:
Dan Diephouse

Field Summary
 
Fields inherited from interface org.codehaus.xfire.java.mapping.TypeMappingRegistry
ROLE
 
Constructor Summary
DefaultTypeMappingRegistry()
           
 
Method Summary
 void clear()
          Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry.
 void configure(org.codehaus.plexus.configuration.PlexusConfiguration config)
           
 TypeMapping createTypeMapping(boolean autoTypes)
          Creates a new empty TypeMapping object.
 TypeMapping createTypeMapping(java.lang.String parentNamespace, boolean autoTypes)
          Create a type mapping with the specified encodying style.
protected  TypeMapping createTypeMapping(TypeMapping parent, boolean autoTypes)
           
 TypeMapping getDefaultTypeMapping()
          Gets the registered default TypeMapping instance.
 java.lang.String[] getRegisteredEncodingStyleURIs()
          Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance.
 TypeMapping getTypeMapping(java.lang.String encodingStyleURI)
          Returns the registered TypeMapping for the specified encodingStyle URI.
 TypeMapping register(java.lang.String encodingStyleURI, TypeMapping mapping)
           
 void registerDefault(TypeMapping mapping)
           
 boolean removeTypeMapping(TypeMapping mapping)
          Removes a TypeMapping from the TypeMappingRegistry.
 TypeMapping unregisterTypeMapping(java.lang.String encodingStyleURI)
          Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI.
 
Methods inherited from class org.codehaus.xfire.plexus.PlexusXFireComponent
getServiceLocator, service
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTypeMappingRegistry

public DefaultTypeMappingRegistry()
Method Detail

register

public TypeMapping register(java.lang.String encodingStyleURI,
                            TypeMapping mapping)
Specified by:
register in interface TypeMappingRegistry
See Also:
org.codehaus.xfire.java.mapping.TypeMappingRegistry#register(java.lang.String, org.codehaus.xfire.java.encoding.TypeMapping)

registerDefault

public void registerDefault(TypeMapping mapping)
Specified by:
registerDefault in interface TypeMappingRegistry
See Also:
org.codehaus.xfire.java.mapping.TypeMappingRegistry#registerDefault(org.codehaus.xfire.java.encoding.TypeMapping)

getDefaultTypeMapping

public TypeMapping getDefaultTypeMapping()
Description copied from interface: TypeMappingRegistry
Gets the registered default TypeMapping instance. This method returns null if there is no registered default TypeMapping in the registry.

Specified by:
getDefaultTypeMapping in interface TypeMappingRegistry
Returns:
The registered default TypeMapping instance or null.
See Also:
TypeMappingRegistry.getDefaultTypeMapping()

getRegisteredEncodingStyleURIs

public java.lang.String[] getRegisteredEncodingStyleURIs()
Description copied from interface: TypeMappingRegistry
Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance.

Specified by:
getRegisteredEncodingStyleURIs in interface TypeMappingRegistry
Returns:
Array of the registered encodingStyle URIs
See Also:
TypeMappingRegistry.getRegisteredEncodingStyleURIs()

getTypeMapping

public TypeMapping getTypeMapping(java.lang.String encodingStyleURI)
Description copied from interface: TypeMappingRegistry
Returns the registered TypeMapping for the specified encodingStyle URI. If there is no registered TypeMapping for the specified encodingStyleURI, this method returns null.

Specified by:
getTypeMapping in interface TypeMappingRegistry
Parameters:
encodingStyleURI - Encoding style specified as an URI
Returns:
TypeMapping for the specified encodingStyleURI or null
See Also:
TypeMappingRegistry.getTypeMapping(java.lang.String)

createTypeMapping

public TypeMapping createTypeMapping(boolean autoTypes)
Description copied from interface: TypeMappingRegistry
Creates a new empty TypeMapping object.

Specified by:
createTypeMapping in interface TypeMappingRegistry
Returns:
TypeMapping instance.
See Also:
org.codehaus.xfire.java.mapping.TypeMappingRegistry#createTypeMapping()

createTypeMapping

public TypeMapping createTypeMapping(java.lang.String parentNamespace,
                                     boolean autoTypes)
Description copied from interface: TypeMappingRegistry
Create a type mapping with the specified encodying style.

Specified by:
createTypeMapping in interface TypeMappingRegistry
Returns:
See Also:
org.codehaus.xfire.java.mapping.TypeMappingRegistry#createTypeMapping(java.lang.String)

createTypeMapping

protected TypeMapping createTypeMapping(TypeMapping parent,
                                        boolean autoTypes)

unregisterTypeMapping

public TypeMapping unregisterTypeMapping(java.lang.String encodingStyleURI)
Description copied from interface: TypeMappingRegistry
Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI.

Specified by:
unregisterTypeMapping in interface TypeMappingRegistry
Parameters:
encodingStyleURI - Encoding style specified as an URI
Returns:
TypeMapping instance that has been unregistered or null if there was no TypeMapping registered for the specified encodingStyleURI
See Also:
TypeMappingRegistry.unregisterTypeMapping(java.lang.String)

removeTypeMapping

public boolean removeTypeMapping(TypeMapping mapping)
Description copied from interface: TypeMappingRegistry
Removes a 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.

Specified by:
removeTypeMapping in interface TypeMappingRegistry
Parameters:
mapping - TypeMapping to remove
Returns:
true if specified TypeMapping is removed from the TypeMappingRegistry; false if the specified TypeMapping was not in the TypeMappingRegistry
See Also:
org.codehaus.xfire.java.mapping.TypeMappingRegistry#removeTypeMapping(org.codehaus.xfire.java.encoding.TypeMapping)

clear

public void clear()
Description copied from interface: TypeMappingRegistry
Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry.

Specified by:
clear in interface TypeMappingRegistry
See Also:
TypeMappingRegistry.clear()

configure

public void configure(org.codehaus.plexus.configuration.PlexusConfiguration config)
               throws org.codehaus.plexus.configuration.PlexusConfigurationException
Specified by:
configure in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Configurable
org.codehaus.plexus.configuration.PlexusConfigurationException
See Also:
org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)


Copyright © 2004 Codehaus. All Rights Reserved.