jaxx.runtime
Class JAXXUtil

java.lang.Object
  extended by jaxx.runtime.JAXXUtil
Direct Known Subclasses:
SwingUtil, Util

public class JAXXUtil
extends Object


Field Summary
static String PARENT
           
 
Constructor Summary
JAXXUtil()
           
 
Method Summary
static void applyDataBinding(JAXXObject src, Collection<String> bindings)
          Convinient method to apply more than one binding on a JAXX ui.
static void applyDataBinding(JAXXObject src, String... bindings)
          Convinient method to apply more than one binding on a JAXX ui.
static boolean assignment(boolean value, String name, JAXXObject src)
           
static byte assignment(byte value, String name, JAXXObject src)
           
static char assignment(char value, String name, JAXXObject src)
           
static double assignment(double value, String name, JAXXObject src)
           
static float assignment(float value, String name, JAXXObject src)
           
static int assignment(int value, String name, JAXXObject src)
           
static long assignment(long value, String name, JAXXObject src)
           
static Object assignment(Object value, String name, JAXXObject src)
           
static short assignment(short value, String name, JAXXObject src)
           
protected static
<O> Class<List<O>>
castList()
           
static
<T> T
checkJAXXContextEntry(JAXXContext context, JAXXContextEntryDef<T> def)
          Test if a type of entry exists in a given context and throw an IllegalArgumentException if not found.
static JAXXObjectDescriptor decodeCompressedJAXXObjectDescriptor(String descriptor)
           
static JAXXObjectDescriptor decodeJAXXObjectDescriptor(String descriptor)
          Decodes the serialized representation of a JAXXObjectDescriptor.
static PropertyChangeListener[] findJaxxPropertyChangeListener(String[] propertyNames, PropertyChangeListener... listeners)
          detects all PropertychangedListener added by Jaxx uis (should be a DataBindingListener
static DataBindingUpdateListener getDataBindingUpdateListener(JAXXObject object, String bindingName)
           
static
<E extends EventListener>
E
getEventListener(Class<E> listenerClass, Object methodContainer, String methodName)
           
static
<E extends EventListener>
E
getEventListener(Class<E> listenerClass, String listenerMethodName, Object methodContainer, String methodName)
           
static String getStringValue(Object value)
          Compute the string representation of an object.
static void initContext(JAXXObject ui, JAXXContext parentContext)
          Method to initialize the context of a ui.
static
<O> JAXXContextEntryDef<O>
newContextEntryDef(Class<O> klass)
           
static
<O> JAXXContextEntryDef<O>
newContextEntryDef(String name, Class<O> klass)
           
static
<O> JAXXContextEntryDef<List<O>>
newListContextEntryDef()
           
static
<O> JAXXContextEntryDef<List<O>>
newListContextEntryDef(String name)
           
static void processDataBinding(JAXXObject src, String... bindings)
          Convinient method to process more than one binding on a JAXX ui.
static void removeDataBinding(JAXXObject src, String... bindings)
          Convinient method to remove more than one binding on a JAXX ui.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARENT

public static final String PARENT
See Also:
Constant Field Values
Constructor Detail

JAXXUtil

public JAXXUtil()
Method Detail

decodeJAXXObjectDescriptor

public static JAXXObjectDescriptor decodeJAXXObjectDescriptor(String descriptor)
Decodes the serialized representation of a JAXXObjectDescriptor. The string must be a byte-to-character mapping of the binary serialization data for a JAXXObjectDescriptor. See the comments in JAXXCompiler.createJAXXObjectDescriptorField for the rationale behind this (admittedly ugly) approach.

Parameters:
descriptor - descriptor to decode
Returns:
the dedoced descriptor

decodeCompressedJAXXObjectDescriptor

public static JAXXObjectDescriptor decodeCompressedJAXXObjectDescriptor(String descriptor)

newContextEntryDef

public static <O> JAXXContextEntryDef<O> newContextEntryDef(Class<O> klass)

newContextEntryDef

public static <O> JAXXContextEntryDef<O> newContextEntryDef(String name,
                                                            Class<O> klass)

newListContextEntryDef

public static <O> JAXXContextEntryDef<List<O>> newListContextEntryDef()

newListContextEntryDef

public static <O> JAXXContextEntryDef<List<O>> newListContextEntryDef(String name)

castList

protected static <O> Class<List<O>> castList()

initContext

public static void initContext(JAXXObject ui,
                               JAXXContext parentContext)
Method to initialize the context of a ui.

Parameters:
ui - the ui
parentContext - the context to set in ui

getEventListener

public static <E extends EventListener> E getEventListener(Class<E> listenerClass,
                                                           String listenerMethodName,
                                                           Object methodContainer,
                                                           String methodName)

getEventListener

public static <E extends EventListener> E getEventListener(Class<E> listenerClass,
                                                           Object methodContainer,
                                                           String methodName)

getDataBindingUpdateListener

public static DataBindingUpdateListener getDataBindingUpdateListener(JAXXObject object,
                                                                     String bindingName)

assignment

public static boolean assignment(boolean value,
                                 String name,
                                 JAXXObject src)

assignment

public static byte assignment(byte value,
                              String name,
                              JAXXObject src)

assignment

public static short assignment(short value,
                               String name,
                               JAXXObject src)

assignment

public static int assignment(int value,
                             String name,
                             JAXXObject src)

assignment

public static long assignment(long value,
                              String name,
                              JAXXObject src)

assignment

public static float assignment(float value,
                               String name,
                               JAXXObject src)

assignment

public static double assignment(double value,
                                String name,
                                JAXXObject src)

assignment

public static char assignment(char value,
                              String name,
                              JAXXObject src)

assignment

public static Object assignment(Object value,
                                String name,
                                JAXXObject src)

getStringValue

public static String getStringValue(Object value)
Compute the string representation of an object.

Return empty string if given object is null

Parameters:
value - the value to write
Returns:
the string representation of the given object or an empty string if object is null.

checkJAXXContextEntry

public static <T> T checkJAXXContextEntry(JAXXContext context,
                                          JAXXContextEntryDef<T> def)
                               throws IllegalArgumentException
Test if a type of entry exists in a given context and throw an IllegalArgumentException if not found.

If entry is found, return his value in context.

Type Parameters:
T - the type of required data
Parameters:
context - the context to test
def - the definition of the entry to seek in context
Returns:
the value from the context
Throws:
IllegalArgumentException - if the entry is not found in context.

applyDataBinding

public static void applyDataBinding(JAXXObject src,
                                    String... bindings)
Convinient method to apply more than one binding on a JAXX ui.

Parameters:
src - the ui to treate
bindings - the list of binding to process.

applyDataBinding

public static void applyDataBinding(JAXXObject src,
                                    Collection<String> bindings)
Convinient method to apply more than one binding on a JAXX ui.

Parameters:
src - the ui to treate
bindings - the list of binding to process.

processDataBinding

public static void processDataBinding(JAXXObject src,
                                      String... bindings)
Convinient method to process more than one binding on a JAXX ui.

Parameters:
src - the ui to treate
bindings - the list of binding to process.

removeDataBinding

public static void removeDataBinding(JAXXObject src,
                                     String... bindings)
Convinient method to remove more than one binding on a JAXX ui.

Parameters:
src - the ui to treate
bindings - the list of binding to process.

findJaxxPropertyChangeListener

public static PropertyChangeListener[] findJaxxPropertyChangeListener(String[] propertyNames,
                                                                      PropertyChangeListener... listeners)
detects all PropertychangedListener added by Jaxx uis (should be a DataBindingListener

Parameters:
propertyNames - the array of property names to find
listeners - the array of listeners to filter
Returns:
the filtered listeners


Copyright © 2008-2010 CodeLutin. All Rights Reserved.