Class DataBinding

  • Direct Known Subclasses:
    PseudoClassDataBinding

    public class DataBinding
    extends Object
    Represents a data binding in a JAXX file. DataBinding uses DataSource to track changes to a source expression and update the destination.
    • Field Detail

      • log

        protected static final org.apache.logging.log4j.Logger log
        Logger.
      • constantId

        protected 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 String processDataBinding
        code to add to processDataBinding (null if no binding)
      • initDataBinding

        protected String initDataBinding
        code to register the databinding (null if no binding)
      • methods

        protected final List<JavaMethod> methods
        Extra method to add to the binding
    • Constructor Detail

      • DataBinding

        public DataBinding​(String id,
                           String source,
                           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 String getAssignment()
      • getSource

        public String getSource()
      • isQuickNoDependencies

        public boolean isQuickNoDependencies()
      • getProcessDataBinding

        public String getProcessDataBinding()
      • getInitDataBinding

        public String getInitDataBinding()
      • getRealId

        public String getRealId()
      • getConstantId

        public String getConstantId()
      • 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
      • getProcessDataBindingCode

        protected String getProcessDataBindingCode​(JAXXCompiler compiler,
                                                   DataSource dataSource,
                                                   boolean isBinding)