jaxx.compiler.binding
Class DataBinding

java.lang.Object
  extended by jaxx.compiler.binding.DataBinding
Direct Known Subclasses:
PseudoClassDataBinding

public class DataBinding
extends java.lang.Object

Represents a data binding in a JAXX file. DataBinding uses DataSource to track changes to a source expression and update the destination.


Field Summary
protected  java.lang.String constantId
          Constant id build from the realId and used instead of realId in generated code
protected  DataSource dataSource
          Compiled data source
protected  java.lang.String initDataBinding
          code to register the databinding (null if no binding)
protected static org.apache.commons.logging.Log log
          Logger
protected  java.util.List<JavaMethod> methods
          Extra method to add to the binding
protected  java.lang.String processDataBinding
          code to add to processDataBinding (null if no binding)
 
Constructor Summary
DataBinding(java.lang.String id, java.lang.String source, java.lang.String assignment, boolean quickNoDependencies)
          Creates a new data binding.
 
Method Summary
 boolean compile(JAXXCompiler compiler)
          Compiles the data binding expression.
 java.lang.String getAssignment()
           
 java.lang.String getConstantId()
           
 java.lang.String getInitDataBinding()
           
protected  java.lang.String getInitDataBindingCode(JAXXCompiler compiler, DataSource dataSource, boolean isBinding)
           
 java.util.List<JavaMethod> getMethods()
           
 java.lang.String getProcessDataBinding()
           
protected  java.lang.String getProcessDataBindingCode(JAXXCompiler compiler, DataSource dataSource, boolean isBinding)
           
 java.lang.String getRealId()
           
 java.lang.String getSource()
           
 DataListener[] getTrackers()
           
 boolean isQuickNoDependencies()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Logger


constantId

protected java.lang.String constantId
Constant id build from the realId and used instead of realId in generated code


dataSource

protected DataSource dataSource
Compiled data source


processDataBinding

protected java.lang.String processDataBinding
code to add to processDataBinding (null if no binding)


initDataBinding

protected java.lang.String initDataBinding
code to register the databinding (null if no binding)


methods

protected final java.util.List<JavaMethod> methods
Extra method to add to the binding

Constructor Detail

DataBinding

public DataBinding(java.lang.String id,
                   java.lang.String source,
                   java.lang.String assignment,
                   boolean quickNoDependencies)
Creates a new data binding.

Parameters:
id - the data binding destination in the form id.propertyName
source - the Java source code for the data binding expression
assignment - Java snippet which will cause the destination property to be updated with the current value of the binding
quickNoDependencies - internal flag to not treate process databinding in not a real binding
Method Detail

getAssignment

public java.lang.String getAssignment()

getSource

public java.lang.String getSource()

isQuickNoDependencies

public boolean isQuickNoDependencies()

getProcessDataBinding

public java.lang.String getProcessDataBinding()

getInitDataBinding

public java.lang.String getInitDataBinding()

getTrackers

public DataListener[] getTrackers()

getRealId

public java.lang.String getRealId()

getConstantId

public java.lang.String getConstantId()

getMethods

public java.util.List<JavaMethod> getMethods()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compile

public boolean compile(JAXXCompiler compiler)
                throws CompilerException
Compiles the data binding expression. This method calls methods in JAXXCompiler to add the Java code that performs the data binding setup.

Parameters:
compiler - compiler which includes the data binding
Returns:
true if the expression has dependencies, false otherwise
Throws:
CompilerException - if a compilation error occurs

getInitDataBindingCode

protected java.lang.String getInitDataBindingCode(JAXXCompiler compiler,
                                                  DataSource dataSource,
                                                  boolean isBinding)

getProcessDataBindingCode

protected java.lang.String getProcessDataBindingCode(JAXXCompiler compiler,
                                                     DataSource dataSource,
                                                     boolean isBinding)


Copyright © 2008-2010 CodeLutin. All Rights Reserved.