org.castor.mapping
Class MappingUnmarshaller

java.lang.Object
  extended by org.castor.mapping.MappingUnmarshaller

public final class MappingUnmarshaller
extends java.lang.Object

Version:
$Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
Author:
Ralf Joachim

Constructor Summary
MappingUnmarshaller()
          Construct a new MappingUnmarshaller.
 
Method Summary
 MappingLoader getMappingLoader(Mapping mapping, BindingType bindingType)
          Returns a mapping resolver for the suitable engine.
 MappingLoader getMappingLoader(Mapping mapping, BindingType bindingType, java.lang.Object param)
          Returns a mapping resolver for the suitable engine.
protected  void loadMappingInternal(Mapping mapping, DTDResolver resolver, java.lang.String url)
          Internal recursive loading method.
 void loadMappingOnly(Mapping mapping)
           
 void setAllowRedefinitions(boolean allow)
          Enables or disables the ability to allow the redefinition of class mappings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingUnmarshaller

public MappingUnmarshaller()
Construct a new MappingUnmarshaller.

Method Detail

setAllowRedefinitions

public void setAllowRedefinitions(boolean allow)
Enables or disables the ability to allow the redefinition of class mappings.

Parameters:
allow - a boolean that when true enables redefinitions.

getMappingLoader

public MappingLoader getMappingLoader(Mapping mapping,
                                      BindingType bindingType)
                               throws MappingException
Returns a mapping resolver for the suitable engine. The engine's specific mapping loader is created and used to create engine specific descriptors, returning a suitable mapping resolver. The mapping resolver is cached in memory and returned in subsequent method calls.

Parameters:
mapping - The mapping to load and resolve.
bindingType - The binding type to read from mapping.
Returns:
A mapping resolver.
Throws:
MappingException - A mapping error occured preventing descriptors from being generated from the loaded mapping.

getMappingLoader

public MappingLoader getMappingLoader(Mapping mapping,
                                      BindingType bindingType,
                                      java.lang.Object param)
                               throws MappingException
Returns a mapping resolver for the suitable engine. The engine's specific mapping loader is created and used to create engine specific descriptors, returning a suitable mapping resolver. The mapping resolver is cached in memory and returned in subsequent method calls.

Parameters:
mapping - The mapping to load and resolve.
bindingType - The binding type to read from mapping.
param - Arbitrary parameter that is to be passed to resolver.loadMapping().
Returns:
A mapping resolver
Throws:
MappingException - A mapping error occured preventing descriptors from being generated from the loaded mapping.

loadMappingOnly

public void loadMappingOnly(Mapping mapping)
                     throws MappingException
Throws:
MappingException

loadMappingInternal

protected void loadMappingInternal(Mapping mapping,
                                   DTDResolver resolver,
                                   java.lang.String url)
                            throws java.io.IOException,
                                   MappingException
Internal recursive loading method. This method will load the mapping document into a mapping object and load all the included mapping along the way into a single collection.

Parameters:
mapping - The mapping instance.
resolver - The entity resolver to use.
url - The URL of the mapping file.
Throws:
java.io.IOException - An error occured when reading the mapping file.
MappingException - The mapping file is invalid.


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com