|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.runtime.context.DefaultJAXXContext
jaxx.runtime.context.DefaultApplicationContext
public class DefaultApplicationContext
The default context to be used for an application.
This extends theDefaultJAXXContext and add a possibility to
auto-instanciate some classes asked via DefaultJAXXContext.getContextValue(Class) and
getContextValue(Class, String) methods.
To registred a such class, just annotate your class with DefaultApplicationContext.AutoLoad.
DefaultJAXXContext| Nested Class Summary | |
|---|---|
static interface |
DefaultApplicationContext.AutoLoad
A class annotated @AutoLoad is used by context to auto instanciate the class when required. |
static interface |
DefaultApplicationContext.MethodAccess
A class annotated @MethodAccess is used by context to obtain the value of an entry via a declared method. |
| Field Summary | |
|---|---|
protected Map<JAXXContextEntryDef<?>,String> |
entryListened
Map of entries to watch associated with the property to fires if a modification was found. |
protected Map<Class<?>,Class<?>> |
forwards
Map of forwarded classes (key) to classes (values). |
protected PropertyChangeSupport |
pcs
to manage properties modifications |
| Fields inherited from class jaxx.runtime.context.DefaultJAXXContext |
|---|
data, PARENT_CONTEXT_ENTRY, parentContext |
| Constructor Summary | |
|---|---|
DefaultApplicationContext()
|
|
| Method Summary | ||
|---|---|---|
void |
addPropertyChangeListener(JAXXContextEntryDef<?> entry,
String name,
PropertyChangeListener listener)
To add a listen modification of the given entry in the context. |
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
|
protected void |
fireEntryChanged(Class<?> klass,
String name,
Object oldValue,
Object newValue)
|
|
protected void |
fireEntryChanged(JAXXContextEntryDef<?> entryDef,
Object oldValue,
Object newValue)
|
|
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> klass,
String name)
Remove from context the value with the given klazz as an unamed (if name is null) or named entry |
|
void |
removePropertyChangeListener(JAXXContextEntryDef<?> entry,
String name,
PropertyChangeListener listener)
To remove a listen modification of the given entry in the context. |
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
|
|
setContextValue(T o,
String name)
* Push in the context a new amed entry. |
|
| Methods inherited from class jaxx.runtime.context.DefaultJAXXContext |
|---|
clear, getContextValue, getEntry, getKey, getKeys, getParentContext, remove0, removeContextValue, setContextValue, setParentContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<Class<?>,Class<?>> forwards
protected Map<JAXXContextEntryDef<?>,String> entryListened
protected PropertyChangeSupport pcs
| Constructor Detail |
|---|
public DefaultApplicationContext()
| Method Detail |
|---|
public <T> T getContextValue(Class<T> clazz,
String name)
JAXXContext
getContextValue in interface JAXXContextgetContextValue in class DefaultJAXXContextT - type of data to obtain from contextclazz - the class of named entry to seek in contextname - the name of the entry to seek in context
null if no such entry.
public <T> void removeContextValue(Class<T> klass,
String name)
JAXXContext
removeContextValue in interface JAXXContextremoveContextValue in class DefaultJAXXContextT - type of data to remove from contextklass - the klazz entryname - extra name of the entry
public <T> void setContextValue(T o,
String name)
JAXXContext
setContextValue in interface JAXXContextsetContextValue in class DefaultJAXXContextT - type of data to set in contexto - the value to push in contextname - the name of the new entry
public void addPropertyChangeListener(JAXXContextEntryDef<?> entry,
String name,
PropertyChangeListener listener)
entry - the entry to listenname - the property name to fire if necessarylistener - the listener to notify if entry has changed
public void removePropertyChangeListener(JAXXContextEntryDef<?> entry,
String name,
PropertyChangeListener listener)
entry - the entry to listenname - the property name to fire if necessarylistener - the listener to notify if entry has changedpublic void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
public boolean hasListeners(String propertyName)
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
public PropertyChangeListener[] getPropertyChangeListeners()
protected void fireEntryChanged(Class<?> klass,
String name,
Object oldValue,
Object newValue)
protected void fireEntryChanged(JAXXContextEntryDef<?> entryDef,
Object oldValue,
Object newValue)
protected Object newInstance(Class<?> clazz)
throws IllegalArgumentException
IllegalArgumentException
protected Object newAccess(Class<?> clazz,
Object parent,
String methodName,
String name)
throws IllegalArgumentException
IllegalArgumentException
protected Object newAccess(Class<?> clazz,
Object parent,
String methodName)
throws IllegalArgumentException
IllegalArgumentException
protected void firePropertyChange(String name,
Object oldValue,
Object newValue)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||