org.apache.commons.betwixt.io.read
Class ReadContext

java.lang.Object
  |
  +--org.apache.commons.betwixt.expression.Context
        |
        +--org.apache.commons.betwixt.io.read.ReadContext

public class ReadContext
extends Context

Extends Context to provide read specific functionality.

Since:
0.5
Author:
Robert Burrell Donkin

Constructor Summary
ReadContext(org.apache.commons.betwixt.BindingConfiguration bindingConfiguration, org.apache.commons.betwixt.io.read.ReadConfiguration readConfiguration)
          Constructs a ReadContext with standard log.
ReadContext(org.apache.commons.betwixt.expression.Context context, org.apache.commons.betwixt.io.read.ReadConfiguration readConfiguration)
          Constructs a ReadContext with the same settings as an existing Context.
ReadContext(org.apache.commons.logging.Log log, org.apache.commons.betwixt.BindingConfiguration bindingConfiguration, org.apache.commons.betwixt.io.read.ReadConfiguration readConfiguration)
          Base constructor
ReadContext(org.apache.commons.betwixt.io.read.ReadContext readContext)
          Constructs a ReadContext with the same settings as an existing Context.
 
Method Summary
 void clearBeans()
          Clears the beans indexed by id.
 java.lang.Object getBean(java.lang.String id)
          Gets a bean from storage by an (xml) ID.
 org.apache.commons.betwixt.io.read.BeanCreationChain getBeanCreationChain()
          Gets the BeanCreationChange to be used to create beans when an element is mapped.
 java.lang.ClassLoader getClassLoader()
          Gets the classloader to be used.
 void putBean(java.lang.String id, java.lang.Object bean)
          Puts a bean into storage indexed by an (xml) ID.
 void setClassLoader(java.lang.ClassLoader classLoader)
          Sets the classloader to be used.
 
Methods inherited from class org.apache.commons.betwixt.expression.Context
getBean, getClassNameAttribute, getLog, getMapIDs, getObjectStringConverter, getVariable, getVariables, newContext, setBean, setClassNameAttribute, setLog, setVariable, setVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadContext

public ReadContext(org.apache.commons.betwixt.expression.Context context,
                   org.apache.commons.betwixt.io.read.ReadConfiguration readConfiguration)
Constructs a ReadContext with the same settings as an existing Context.

Parameters:
context - not null
readConfiguration - not null

ReadContext

public ReadContext(org.apache.commons.betwixt.BindingConfiguration bindingConfiguration,
                   org.apache.commons.betwixt.io.read.ReadConfiguration readConfiguration)
Constructs a ReadContext with standard log.

Parameters:
bindingConfiguration - the dynamic configuration, not null
readConfiguration - the extra read configuration not null

ReadContext

public ReadContext(org.apache.commons.logging.Log log,
                   org.apache.commons.betwixt.BindingConfiguration bindingConfiguration,
                   org.apache.commons.betwixt.io.read.ReadConfiguration readConfiguration)
Base constructor

Parameters:
log - log to this Log
bindingConfiguration - the dynamic configuration, not null
readConfiguration - the extra read configuration not null

ReadContext

public ReadContext(org.apache.commons.betwixt.io.read.ReadContext readContext)
Constructs a ReadContext with the same settings as an existing Context.

Parameters:
readContext - not null
Method Detail

putBean

public void putBean(java.lang.String id,
                    java.lang.Object bean)
Puts a bean into storage indexed by an (xml) ID.

Parameters:
id - the ID string of the xml element associated with the bean
bean - the Object to store, not null

getBean

public java.lang.Object getBean(java.lang.String id)
Gets a bean from storage by an (xml) ID.

Parameters:
id - the ID string of the xml element associated with the bean
Returns:
the Object that the ID references, otherwise null

clearBeans

public void clearBeans()
Clears the beans indexed by id.


getClassLoader

public java.lang.ClassLoader getClassLoader()
Gets the classloader to be used.

Returns:
the classloader that should be used to load all classes, possibly null

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)
Sets the classloader to be used.

Parameters:
classLoader - the ClassLoader to be used, possibly null

getBeanCreationChain

public org.apache.commons.betwixt.io.read.BeanCreationChain getBeanCreationChain()
Gets the BeanCreationChange to be used to create beans when an element is mapped.

Returns:
the BeanCreationChain not null


Copyright © 2002-2004 The Apache Software Foundation. All Rights Reserved.