jaxx.runtime.context
Class DefaultApplicationContext
java.lang.Object
jaxx.runtime.context.DefaultJAXXContext
jaxx.runtime.context.DefaultApplicationContext
- All Implemented Interfaces:
- JAXXContext
public class DefaultApplicationContext
- extends DefaultJAXXContext
The default context to be used for an application.
This extends the DefaultJAXXContext and add a possibility to auto-instanciate
some classes asked via DefaultJAXXContext.getContextValue(java.lang.Class) and
getContextValue(java.lang.Class, java.lang.String) methods.
To registred a such class, just annotate your class with DefaultApplicationContext.AutoLoad.
- Since:
- 1.2
- Author:
- chemit
- See Also:
DefaultJAXXContext
|
Method Summary |
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
protected void |
firePropertyChange(String name,
Object oldValue,
Object newValue)
|
|
getContextValue(Class<T> clazz,
String name)
Seek for a named entry in the context |
PropertyChangeListener[] |
getPropertyChangeListeners()
|
PropertyChangeListener[] |
getPropertyChangeListeners(String propertyName)
|
boolean |
hasListeners(String propertyName)
|
protected Object |
newAccess(Class<?> clazz,
Object parent,
String methodName)
|
protected Object |
newAccess(Class<?> clazz,
Object parent,
String methodName,
String name)
|
protected Object |
newInstance(Class<?> clazz)
|
|
removeContextValue(Class<T> klazz,
String name)
Remove from context the value with the given klazz as an unamed (if name is null) or named entry |
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
forwards
protected Map<Class<?>,Class<?>> forwards
- Map of forwarded classes (key) to classes (values).
pcs
protected PropertyChangeSupport pcs
- to manage properties modifications
DefaultApplicationContext
public DefaultApplicationContext()
getContextValue
public <T> T getContextValue(Class<T> clazz,
String name)
- Description copied from interface:
JAXXContext
- Seek for a named entry in the context
- Specified by:
getContextValue in interface JAXXContext- Overrides:
getContextValue in class DefaultJAXXContext
- Type Parameters:
T - type of data to obtain from context- Parameters:
clazz - the class of named entry to seek in contextname - the name of the entry to seek in context
- Returns:
- the value of the named entry for the given class, or
null if no such entry.
removeContextValue
public <T> void removeContextValue(Class<T> klazz,
String name)
- Description copied from interface:
JAXXContext
- Remove from context the value with the given klazz as an unamed (if name is null) or named entry
- Specified by:
removeContextValue in interface JAXXContext- Overrides:
removeContextValue in class DefaultJAXXContext
- Type Parameters:
T - type of data to remove from context- Parameters:
klazz - the klazz entryname - extra name of the entry
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
hasListeners
public boolean hasListeners(String propertyName)
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners()
newInstance
protected Object newInstance(Class<?> clazz)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
newAccess
protected Object newAccess(Class<?> clazz,
Object parent,
String methodName,
String name)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
newAccess
protected Object newAccess(Class<?> clazz,
Object parent,
String methodName)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
firePropertyChange
protected void firePropertyChange(String name,
Object oldValue,
Object newValue)
Copyright © 2008-2010 CodeLutin. All Rights Reserved.