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
|
Field Summary |
protected java.util.Map<java.lang.Class<?>,java.lang.Class<?>> |
forwards
Map of forwarded classes (key) to classes (values). |
protected java.beans.PropertyChangeSupport |
pcs
to manage properties modifications |
|
Method Summary |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
|
protected void |
firePropertyChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
|
|
getContextValue(java.lang.Class<T> clazz,
java.lang.String name)
Seek for a named entry in the context |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners()
|
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners(java.lang.String propertyName)
|
boolean |
hasListeners(java.lang.String propertyName)
|
protected java.lang.Object |
newAccess(java.lang.Class<?> clazz,
java.lang.Object parent,
java.lang.String methodName)
|
protected java.lang.Object |
newAccess(java.lang.Class<?> clazz,
java.lang.Object parent,
java.lang.String methodName,
java.lang.String name)
|
protected java.lang.Object |
newInstance(java.lang.Class<?> clazz)
|
|
removeContextValue(java.lang.Class<T> klazz,
java.lang.String name)
Remove from context the value with the given klazz as an unamed (if name is null) or named entry |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
forwards
protected java.util.Map<java.lang.Class<?>,java.lang.Class<?>> forwards
- Map of forwarded classes (key) to classes (values).
pcs
protected java.beans.PropertyChangeSupport pcs
- to manage properties modifications
DefaultApplicationContext
public DefaultApplicationContext()
getContextValue
public <T> T getContextValue(java.lang.Class<T> clazz,
java.lang.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(java.lang.Class<T> klazz,
java.lang.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(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
hasListeners
public boolean hasListeners(java.lang.String propertyName)
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
newInstance
protected java.lang.Object newInstance(java.lang.Class<?> clazz)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
newAccess
protected java.lang.Object newAccess(java.lang.Class<?> clazz,
java.lang.Object parent,
java.lang.String methodName,
java.lang.String name)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
newAccess
protected java.lang.Object newAccess(java.lang.Class<?> clazz,
java.lang.Object parent,
java.lang.String methodName)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
firePropertyChange
protected void firePropertyChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
Copyright © 2008-2010 CodeLutin. All Rights Reserved.