|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.compiler.binding.DataBindingHelper
public class DataBindingHelper
Helper to be used by compiler to treate data bindings.
Note : The code in this class was previously directly in JAXXCompiler, now prefer have a separate class to makeJAXXCompiler more simple and clear.
Created: 27 nov. 2009
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Integer> |
autoUnsafeGenIds
Counter by unsafe type |
protected JAXXCompiler |
compiler
Associated compiler |
protected java.util.List<DataBinding> |
dataBindings
Registred data binding for the compiler, then after the invocation of method finalizeBindings()
only the real data bindings, the simple bindings will be moved to simpleBindings. |
protected static java.util.regex.Matcher |
leftBraceMatcher
left brace matcher |
protected static java.util.regex.Matcher |
rightBraceMatcher
right brace matcher |
static boolean |
SHOW_LOG
To debug binding without any log interference |
protected java.util.List<DataBinding> |
simpleBindings
Simpel bindings for the compiler |
| Constructor Summary | |
|---|---|
DataBindingHelper(JAXXCompiler compiler)
|
|
| Method Summary | |
|---|---|
void |
clear()
|
void |
finalizeBindings()
Compile all binding discovered previously. |
DataBinding[] |
getDataBindings()
|
protected static int |
getNextLeftBrace(java.lang.String string,
int pos)
|
protected static int |
getNextRightBrace(java.lang.String string,
int pos)
|
java.lang.String |
getSafeId(java.lang.String id)
Obtain the next safe id for the given binding id. |
DataBinding[] |
getSimpleBindings()
|
static java.lang.String |
processDataBindings(java.lang.String stringValue)
Examine an attribute value for data binding expressions. |
void |
registerDataBinding(DataBinding binding)
|
void |
registerDataBinding(java.lang.String id,
java.lang.String binding,
java.lang.String assignment)
|
void |
revertSafeId(java.lang.String id)
Revert a previous computed safe id. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean SHOW_LOG
protected static final java.util.regex.Matcher leftBraceMatcher
protected static final java.util.regex.Matcher rightBraceMatcher
protected final java.util.List<DataBinding> dataBindings
finalizeBindings()
only the real data bindings, the simple bindings will be moved to simpleBindings.
protected final java.util.List<DataBinding> simpleBindings
protected final JAXXCompiler compiler
protected final java.util.Map<java.lang.String,java.lang.Integer> autoUnsafeGenIds
| Constructor Detail |
|---|
public DataBindingHelper(JAXXCompiler compiler)
| Method Detail |
|---|
public static java.lang.String processDataBindings(java.lang.String stringValue)
throws CompilerException
registerDataBinding(java.lang.String, java.lang.String, java.lang.String).
If the attribute value does not invoke data binding, this method returns null
stringValue - the string value of the property from the XML
CompilerException - ?public DataBinding[] getDataBindings()
public DataBinding[] getSimpleBindings()
public void registerDataBinding(java.lang.String id,
java.lang.String binding,
java.lang.String assignment)
public void registerDataBinding(DataBinding binding)
public void clear()
public java.lang.String getSafeId(java.lang.String id)
_XXX until
found a free id.
id - the id of the binding
public void revertSafeId(java.lang.String id)
id - the original id to revert in counter.public void finalizeBindings()
dataBindings to simpleBindings.
protected static int getNextLeftBrace(java.lang.String string,
int pos)
protected static int getNextRightBrace(java.lang.String string,
int pos)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||