Regarding Code Generation By Creator

Hi Creator Team,
This is not a bug, but in increasing the readability I have a suggestion in generating the code
Currently creator is doing something like below
private HtmlForm form1=new HtmlForm ();
I agree there is nothing wrong with the code
but if we have method something like initComponents it would be better and increases the readability
my idea is something like below
private HtmlForm form1=null;
public HtmlForm getForm1()
return this.form1;
public void setForm1(HtmlForm form1)
this.form1=form1;
private void initComponents() throws FacesException
form1=new HtmlForm ();
public MyConstructor()
try{
initComponents();
catch(Exception ex)
}Why I like this model is, it increases the readability and if there is a chance of getting exceptions, you can catch them in constructor and can do further jobs.
This is not possible with the current creator application
Hope you understand my concern
Best Regards
Sudhakar Chavali

Hi Sudhakar,
We thank you for your valuable feedback. An RFE has been filed on your behalf for the same.
Cheers
Giri :-)

Similar Messages

  • Error in code generation for deleting table BUT000_TD

    Hi,
    Did anyone encounter this error while working on EEWB ?
    I created the project extension via EEWB and completed the wizard setting with the package (dev. class) value as $temp as I wanted to test it locally.
    One of the errors, that I got is:
    Error in code generation for deleting table BUT000_TD
        Message no. DA464
    Diagnosis
        This error message indicates that internal inconsistencies exist.
    Procedure
        Please consult SAP.

    Hi,
    As I mentioned in my previous post kindly check the consistency of the structure BUT000_TD.
    Regards,
    Sudheer.

  • Generic oracle eway code generation error in Java caps 5.1.3

    Hi,
    I'm using an oracle eway for adding records to a table. I have a prepared statement in the otd. When I try to build the project I'm getting the following error. Could any one let me know how this problem can be fixed?
    com.stc.codegen.framework.model.CodeGenException: Generic Oracle eway code generation error(ERROR_CODEGEN_GENERIC_CODELET_GENERAL)
         at com.stc.oracle.codegen.OracleEWayCodeletFactory$OracleEWayCodelet.generateFiles(OracleEWayCodeletFactory.java:1860)
         at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.processCodelets(CodeGenFrameworkImpl.java:640)
         at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.process(CodeGenFrameworkImpl.java:1544)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:405)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:308)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.traverseDeployment(DeploymentVisitorImpl.java:268)
         at com.stc.codegen.driver.module.DeploymentBuildAction.loadCodeGen(DeploymentBuildAction.java:923)
         at com.stc.codegen.driver.module.DeploymentBuildAction.access$1000(DeploymentBuildAction.java:174)
         at com.stc.codegen.driver.module.DeploymentBuildAction$1.run(DeploymentBuildAction.java:599)
         at org.openide.util.Task.run(Task.java:136)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
    Caused by: com.stc.codegen.framework.model.CodeGenException: Exception when generating OTD code ...Exception: javaClass: Oracle_std_otdOTD: Exception when invoke DB Codegen Task...Exception: Invalid parameter type: Class : [Std_insert_PreapredStat] Object: [Param1] Param Type : [DECIMAL].(ERROR_CODEGEN_DB)(ERROR_CREATE_OTD)
         at com.stc.oracle.codegen.OracleEWayCodeletFactory$OracleEWayCodelet.generateOtdJarFile(OracleEWayCodeletFactory.java:2045)
         at com.stc.oracle.codegen.OracleEWayCodeletFactory$OracleEWayCodelet.generateFiles(OracleEWayCodeletFactory.java:1756)
         ... 10 more
    Regards,
    Abdul

    hi...
    i too getting same problem..how did u reslove this...
    please help me out...
    thanks in advance
    KK

  • Code generation bug in Sun Studio 12

    Hi,
    The following program prints `Failure' when compiled with -xO4 where nothing should be printed (when compiled with no optimization or -xO2). It looks to me that the first comparison `buggy_routine' against 0x80 is returning True where it should return False.
    #include <stdlib.h>
    #include <stdio.h>
    typedef unsigned long long int      EIF_NATURAL_64;
    typedef unsigned char   EIF_BOOLEAN;
    typedef int EIF_INTEGER_32;
    typedef char * EIF_REFERENCE;
    char s[] = "9223372036854775808";
    void buggy_routine (EIF_REFERENCE Current, EIF_NATURAL_64 arg1)
        EIF_NATURAL_64 tu8_1;
        tu8_1 = (EIF_NATURAL_64) ((EIF_INTEGER_32) 128L);
        if ((EIF_BOOLEAN) (arg1 <= tu8_1)) {
        } else {
            if ((EIF_BOOLEAN) (arg1 <= ((EIF_NATURAL_64)  9223372036854775808ull ))) {
            } else {
                  printf("Failure\n");
    int main (int argc, char ** argv, char **envp ) {
        EIF_NATURAL_64 loc2 = (EIF_NATURAL_64) 0;
        loc2 = (EIF_NATURAL_64) atoll(s);
        buggy_routine ("s", loc2);
    }To reproduce:
    cc -xO4 bug.c -o bug ; ./bug
    It fails on both 32 and 64-bit code generation for x86. I haven't tried on Sparc as I need to install Sun Studio 12. Is this a known issue? Is there an easy workaround?
    I tried with Sun Studio 11 and it worked just fine there.
    Regards,
    Manu
    PS: I've tried with both version (the first is the one from the default installation) and the second after I noticed there were some patches available:
    cc: Sun C 5.9 SunOS_i386 Patch 124868-01 2007/07/12
    cc: Sun C 5.9 SunOS_i386 Patch 124868-02 2007/11/27

    An issue filed at bugs.sun.com does not go directly into the bug database. It is evaluated, and if it turns out the report is actually a bug not previously reported, goes into the database. You get a notification and chance to reply after the report is evaluated.
    In this case, I picked up your report myself, and filed the bug. The bug ID is 6654314, and will be visible at bugs.sun.com in a day or two.

  • Code generation error when implementing an accumalator

    Hi everyone,
    I am implementing an accumalator which implements X = X + Y where X and Y are memories of length say 5. Initially I write 5 values into X and Y using a for loop. Then I perform the addition inside a single cycle timed loop and store the results in a temporary buffer(another memory) again of length 5. In another single cycle timed loop, I copy the data from the temporary buffer to memory X.
    I changed the arbitration option to never arbitrate for X, but I get a code generation error because of arbitration. Could anybody please tell how to solve this problem.
    Regards,
    Prashant
    Solved!
    Go to Solution.

    Hi NitzZ
    I figured out a way to solve the problem. I chose the "Never Arbitrate" option for all memories and replaced the for loop with a timed loop. Now there are no errors.
    Thanks,
    Prashant

  • Automatic Code generation from UML for C++ in Visual Studio 2013 Ultimate

    Hi all, 
    I am using Visual Studio 2013 Ultimate to design UML diagrams and want to use the class diagram to generate C++ code,
    however I found that there seems only support C# generation.
    Is there any way to do the code generation (even round-trip engineering with C++/UML model) from Visual Studio 2013 Ultimate?
    There is a way to do C++ code generation by customize the text template file right? but it is time consuming and we don't have much time to do it.:( 
    Thanks a lot!

    Hello Grib,
    >>is there anyway to integrate an STE code generator to Visual Studio 2013. I know there is EF5.x STE Generator but only for VS 2012.
    Yes, you can.
    Since the STEs are T4 template and you can just take template and code any changes or improvements you require yourselves! As you mentions, there is a EF5.x STE generator, you could download it and edit it. You could check this article:
    Upgrading to EF6, we could see that from EF5 to EF6, the team moves classes to a new namespace, so we need to modify the T4 template to generate the new namespace.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem with Web Service Model code generation

    Hello,
    I'm importing two different web services into the same web dynpro component, which both contains properties "allGroup2" of type "All2".
    This causes some problems with the code generation, first of all the Model-classes can't be generated because they don't know which of the two All2-classes to use. If I fix that problem (which can be easily done by adding the correct import statement) I still can't use the models in my web dynpro component, since it too doesn't know which of the All2-classes to use.
    Even though I can fix this by adding imports and fixing the code, it of course gets regenerated next time I rebuild the project, and my changes are lost.
    Does anyone know how to solve this?

    Apparently this is a known bug which is fixed in SP15.
    Regards mattias

  • Business partner auto code generation

    hi how to create business partner auto code generation. its based on customer group for example we have more customer group..dealer, distributor,subcontractor...
    here dealer and distributor group starting cardcode is - C000001,C000002,C000003..... etc
    when i was choose subcontractor its starts SUB00001,SUB00002...... etc
    vendor is maintain same starting letter in all groups V000001,V000002
    Thanks in advance
    Thanks & Regards
    B.Lakshmi Narayanan

    hi thanks for your valuable replies...
    i changed the codes...pls check its right or wrong
    declare @temp as char(20)
    IF $[OCRD.GroupCode] = 104  and $[OCRD.cardtype] = 'c'
    BEGIN
    set @temp=(select isnull(max(right(cardCode,7)),0) + 1 from Ocrd where (groupcode= 104) and (len(cardCode)=7))
    set @temp='TRA'isnull(replicate(0,7-len(@temp)),'')@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.cardtype] = 'C'
    BEGIN
    set @temp=(select isnull(max(right(cardCode,7)),0) + 1 from Ocrd where   (len(cardCode)=7))
    set @temp='C'isnull(replicate(0,7-len(@temp)),'')@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.cardtype] = 'S'
    BEGIN
    set @temp=(select isnull(max(right(cardCode,7)),0) + 1 from Ocrd where   (len(cardCode)=7))
    set @temp='S'isnull(replicate(0,7-len(@temp)),'')@temp
    select cast(@temp as char(20))
    END
    Thanks & Regards
    B.Lakshmi Narayanan

  • BAR code generation in smartforms

    Hi Experts,
                  Can any body suggest me a site for the BAR code generation on the smartforms.

    I have posted some information on this sometime back. Hope it will be helpful
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/design%252bbarcode%252bin%252bnew%252btechnology
    Regards,
    Mohaiyuddin

  • Unique 4 digit alphanumeric code generation.

    Hi Everyone,
    Please look into this code and suggest me, how should I approach to change this streak.
    My DB version is
    BANNER                                                       
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production                         
    CORE 10.2.0.1.0 Production                                       
    TNS for Linux: Version 10.2.0.1.0 - Production                 
    NLSRTL Version 10.2.0.1.0 - Production         
    Please look into this unique 4 digit alphanumeric code generation.
    9999999999999 is just for reference. This is the current behavior.
    If I will put round instead of trunc, will it work for long run, though it's working for few sequence numbers.
    Can I change the order of numbers and alphabets? Please suggest something.
    As per the requirement these alphabets are restricted for the code generation and they are (I, L O, B, Q)
    If you run this code this will give the value as 3688. But 3688 is already exists so it should return something else and it should be full proof in the long run.
    Declare
    VC_SEQ_NUMBER varchar2(4) := NULL;
    BEGIN
    -- First digit (highest) of the alphanumeric
    vc_seq_NUMBER := vc_seq_NUMBER ||
       CASE TO_CHAR (MOD (TRUNC (TRUNC (TRUNC (9999999999999 / 31, 0) / 31,0) /31,0),31))
                    WHEN '0' THEN '0'
                    WHEN '1' THEN '1'
                    WHEN '2' THEN '2'
                    WHEN '3' THEN '3'
                    WHEN '4' THEN '4'
                    WHEN '5' THEN '5'
                    WHEN '6' THEN '6'
                    WHEN '7' THEN '7'
                    WHEN '8' THEN '8'
                    WHEN '9' THEN '9'
                    WHEN '10' THEN 'A'
                    WHEN '11' THEN 'C'
                    WHEN '12' THEN 'D'
                    WHEN '13' THEN 'E'
                    WHEN '14' THEN 'F'
                    WHEN '15' THEN 'G'
                    WHEN '16' THEN 'H'
                    WHEN '17' THEN 'J'
                    WHEN '18' THEN 'K'
                    WHEN '19' THEN 'M'
                    WHEN '20' THEN 'N'
                    WHEN '21' THEN 'P'
                    WHEN '22' THEN 'R'
                    WHEN '23' THEN 'S'
                    WHEN '24' THEN 'T'
                    WHEN '25' THEN 'U'
                    WHEN '26' THEN 'V'
                    WHEN '27' THEN 'W'
                    WHEN '28' THEN 'X'
                    WHEN '29' THEN 'Y'
                    WHEN '30' THEN 'Z'
                 END;
    -- Second digit of the alphanumeric
    vc_seq_NUMBER := vc_seq_NUMBER ||
              CASE TO_CHAR (MOD (TRUNC (TRUNC (9999999999999 / 31, 0) / 31, 0), 31))
                 WHEN '0' THEN '0'
                 WHEN '1' THEN '1'
                 WHEN '2' THEN '2'
                 WHEN '3' THEN '3'
                 WHEN '4' THEN '4'
                 WHEN '5' THEN '5'
                 WHEN '6' THEN '6'
                 WHEN '7' THEN '7'
                 WHEN '8' THEN '8'
                 WHEN '9' THEN '9'
                 WHEN '10' THEN 'A'
                 WHEN '11' THEN 'C'
                 WHEN '12' THEN 'D'
                 WHEN '13' THEN 'E'
                 WHEN '14' THEN 'F'
                 WHEN '15' THEN 'G'
                 WHEN '16' THEN 'H'
                 WHEN '17' THEN 'J'
                 WHEN '18' THEN 'K'
                 WHEN '19' THEN 'M'
                 WHEN '20' THEN 'N'
                 WHEN '21' THEN 'P'
                 WHEN '22' THEN 'R'
                 WHEN '23' THEN 'S'
                 WHEN '24' THEN 'T'
                 WHEN '25' THEN 'U'
                 WHEN '26' THEN 'V'
                 WHEN '27' THEN 'W'
                 WHEN '28' THEN 'X'
                 WHEN '29' THEN 'Y'
                 WHEN '30' THEN 'Z'
              END;
    -- Third digit  of the alphanumeric
    vc_seq_NUMBER := vc_seq_NUMBER ||
              CASE TO_CHAR (MOD (TRUNC (9999999999999 / 31, 0), 31))
                 WHEN '0' THEN '0'
                 WHEN '1' THEN '1'
                 WHEN '2' THEN '2'
                 WHEN '3' THEN '3'
                 WHEN '4' THEN '4'
                 WHEN '5' THEN '5'
                 WHEN '6' THEN '6'
                 WHEN '7' THEN '7'
                 WHEN '8' THEN '8'
                 WHEN '9' THEN '9'
                 WHEN '10' THEN 'A'
                 WHEN '11' THEN 'C'
                 WHEN '12' THEN 'D'
                 WHEN '13' THEN 'E'
                 WHEN '14' THEN 'F'
                 WHEN '15' THEN 'G'
                 WHEN '16' THEN 'H'
                 WHEN '17' THEN 'J'
                 WHEN '18' THEN 'K'
                 WHEN '19' THEN 'M'
                 WHEN '20' THEN 'N'
                 WHEN '21' THEN 'P'
                 WHEN '22' THEN 'R'
                 WHEN '23' THEN 'S'
                 WHEN '24' THEN 'T'
                 WHEN '25' THEN 'U'
                 WHEN '26' THEN 'V'
                 WHEN '27' THEN 'W'
                 WHEN '28' THEN 'X'
                 WHEN '29' THEN 'Y'
                 WHEN '30' THEN 'Z'
              END;
    --Fourth digit OF the alphanumeric
    vc_seq_NUMBER  := vc_seq_NUMBER ||
              CASE TO_CHAR (TRUNC (MOD (9999999999999 , 31), 0) )
                 WHEN '0' THEN '0'
                 WHEN '1' THEN '1'
                 WHEN '2' THEN '2'
                 WHEN '3' THEN '3'
                 WHEN '4' THEN '4'
                 WHEN '5' THEN '5'
                 WHEN '6' THEN '6'
                 WHEN '7' THEN '7'
                 WHEN '8' THEN '8'
                 WHEN '9' THEN '9'
                 WHEN '10' THEN 'A'
                 WHEN '11' THEN 'C'
                 WHEN '12' THEN 'D'
                 WHEN '13' THEN 'E'
                 WHEN '14' THEN 'F'
                 WHEN '15' THEN 'G'
                 WHEN '16' THEN 'H'
                 WHEN '17' THEN 'J'
                 WHEN '18' THEN 'K'
                 WHEN '19' THEN 'M'
                 WHEN '20' THEN 'N'
                 WHEN '21' THEN 'P'
                 WHEN '22' THEN 'R'
                 WHEN '23' THEN 'S'
                 WHEN '24' THEN 'T'
                 WHEN '25' THEN 'U'
                 WHEN '26' THEN 'V'
                 WHEN '27' THEN 'W'
                 WHEN '28' THEN 'X'
                 WHEN '29' THEN 'Y'
                 WHEN '30' THEN 'Z'
              END;
      DBMS_OUTPUT.PUT_LINE('vc_seq_NUMBER : ' || vc_seq_NUMBER);
    END;
    Regards,
    BS2012.

    BluShadow has demonstrated a way to generate Four digit base 36 alphanumeric sequence. I am not sure how much can it scale in a multi user environment. You can take it as a reference to use Sequences in order to be useful in a Multi user env.
    Alphanumeric sequence number generator

  • Refactor - Renaming Problem Auto Code Generation

    After renaming the java source files (backing beans) to upper case letters (ex. from console.java to Console.java),
    JSC is not able to instantiate this class anymore, because the managed-bean.xml is altered automatically.
    The next problem is the jsp-file. JSC produces some useless code which points to the new (by JSC) created managed beans (old ones still exist)
    example (jsp):
    </ui:body>
    </ui:html>
    </ui:page>
    </f:view>
    <ui:body binding="#{request$console.body1}" id="body1"/>
    (managed-beans.xml)
    <managed-bean>
    <managed-bean-name>request$console</managed-bean-name>
    I�m not able to delete this generated code, because after saving and reloading the jsp-file the inserted code is still there.
    In the projects view my java source files are shown in small letters, even if the files are in upper case on the file system (explorer).
    I�m using Studio Creator 2 Update 1 (Build 060915)
    The project can only be deployed (exporting *.war in JSC) and executed when i change the file attributes to read-only after editing them with a standard text editor.
    Any suggestions?

    Hi Naveen,
    I found these two fms's which would enable automatic item code generation. See if it helps you.
    declare @temp as char(20)
    IF $[OITM.ItmsGrpCod] = 101
    BEGIN
    set @temp=(select isnull(max(right(ItemCode,4)),0) + 1 from OITM where (ItmsGrpCod= 101) and (len(ItemCode)=7))
    set @temp='DRM'+isnull(replicate(0,4-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OITM.ItmsGrpCod] = 102
    BEGIN
    set @temp=(select isnull(max(right(ItemCode,4)),0) + 1 from OITM where (ItmsGrpCod= 102) and (len(ItemCode)=7))
    set @temp='PKG'+isnull(replicate(0,4-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    And:
    DECLARE
    @NUM AS CHAR(7)
    SET @NUM =
    (SELECT RIGHT(MAX(CardCode), 7) FROM OITM)
    SET @NUM = @NUM + 1
    BEGIN
    IF @NUM IS NULL OR @NUM = 0
    BEGIN
    SELECT 'I0000001'
    END
    IF @NUM < 10
    BEGIN
    SELECT 'I000000' + @NUM
    END
    IF @NUM > 9 AND @NUM < 100
    BEGIN
    SELECT 'I00000' + @NUM
    END
    ----COMPLETE THE CODE
    END
    Thanks,
    Joseph

  • Command-line building:  code generation / WSDL importing

    Greetings,
    I'm working to setup a somewhat complicated Adobe Flex project that was created with the Flash Builder plugin in Eclipse.
    I cannot seem to find any documentation regarding the code generaton feature on the backend of the Flash Builder plugin.  The only way to access it seems to be via the GUI.
    Normally, I generate the appropriate action script code / objects via the Data/Services wizard in the Flash Builder plugin (importing a WSDL file hosted on a server).  I need to be able to perform this from either an ANT or MAVEN build script.
    I have Flash Builder 4.1 Pro, which is nice, but with multiple developers, I really need a way to build the entire project from the command-line without ever launching the IDE.  Has anyone managed to do this and can point me to the documentation?  So far, my search for Adobe documentation regarding command-line code generation has been fruitless.
    Thanks

    Anyone know of any work arounds?  Blog posts like this seem to leave little hope:
    http://mfeatonby.wordpress.com/2010/03/12/generating-actionscript-classes-from-wsdl/

  • C code generation like math-works​' real time workshop

    is possible to use LabVIEW for atomatic c-code generation like what done by math-works' real time workshop?
    Solved!
    Go to Solution.

    Hi Pritam,
    did you try to search the forum?
    See here or here. Look for "LabView Embedded"!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Error 91 by Statechart Code Generation

    I have problems with statechart formerly created with LV2009. Now I want to use this statechart with LV2012 but by generation of statechart I get the following message:
    Failed to generate statechart. Fehler 91 bei Statechart Code Generation
    Mögliche Ursachen:
    LabVIEW:  Der Datentyp des Variant ist nicht kompatibel mit dem Datentyp, der mit dem Eingang verbunden ist.
    I deleted some VIs with Variant but I get the same message. It is a complex statechart - how can I find the reason for the error? With LV2009 everything was OK - but now I have a new computer with Win7-x64 an want to use LV2012.
    After confirmation of error message i get a lot of error messages with the hint to typdefinitions in State/Inputs/Outputs but in the typdefinitions I didn't do any changes.
    Solved!
    Go to Solution.

    Hi Stephan,
    I could solve the problem meantime by try and error (successive delete of states and so on). A reference to a .net-dll cause the error. The reference was in the StateData.ctl until now, because I need this reference in several states. Now I use a global variable to store the reference - not very nice, but I get no more errors from the statechart. The error message from LV2012 is misleading by this problem.
    Regards,
    Kai

  • Runtime Code Generation and operations on unknown types

    (Post split in two) - Part 1
    Hello,
    The problem is a bit more complex so I will try to explain it as good as possible. Let's consider the following classes and interfaces (trimmed to the essential parts):
    public abstract class Binding {
      private String name;
      public Binding(String name) {
        this.name = name;
      abstract Object getValue();
      // getters & setters
    public interface ExpressionImpl {
      public Object evaluate();
    public class DirectBinding extends Binding {
      private String expression;
      private ExpressionImpl exprImpl;
      public DirectBinding(String name, String expression) {
        super(name);
        this.expression = expression;
        this.exprImpl = /* Call to some code which will generate and load a a class that implements "ExpressionImpl" */
      public Object getValue() {
        return exprImpl.evaluate();
    public class RecursiveBinding extends Binding {
      private String initializationExpression;
      private String recursiveExpression;
      private ExpressionImpl exprImpl;
      public RecursiveBinding(String name, String initializationExpression, String recursiveExpression)  {
        super(name);
        this.initializationExpression= initializationExpression;
        this.recursiveExpression= recursiveExpression;
        this.exprImpl = /* Call to some code which will generate and load a a class that implements "ExpressionImpl" */
      public Object getValue() {
        return exprImpl.evaluate();
    public class Element {
      private List<Element> children;
      private Element parent;
      private List<Binding> bindings;
      // constructor, add, remove, getters and setters
    }So:
    1. Element models a tree node structure (reference to children and parent) and a binding container.
    2. Bindings know their parent element.
    3. A Binding can search and access Bindings from it's parent element or this element's ancestors.
    4. To observe that Bindings return Object values.
    5. Bindings are initialized from top to bottom. So if a child element's binding requires the value of a parent element binding, this is allready available.
    6. Valid expressions for DirectBindings are for example:
    - "100"
    - "3.5D + (new java.util.Random().nextDouble())"
    - "$parent_binding + $ancestor_binding"
    7. Valid expressions for RecursiveBindings are (initialization expression, recursive expression) (for a Binding called "this_binding"):
    - "$parent_binding" , "$this_binding + 1"
    - "100", "$this_binding * $ancestor_binding"
    8. A Binding object deals with values of the same type in it's expression(s) -> only numeric, only boolean. You cannot have "$parent_binding && true" if "parent_binding" returns an Integer object (through it's "Object getValue()" method).
    9. Instead of parsing and evaluating the expressions as strings, classes are generated which return the natural (Java) evaluation of the expressions. Of course valid code will be generated for the expression, so if a binding reference is found, in the generated class it will be replaced with the equivalent "binding.getValue()".

    Part 2
    Let's consider the following code snippet:
    Element parent = new Element("parent");
    parent.addBinding(new DirectBinding("parent_binding", "3.5D"); // Will call this Binding 1
    Element child = new Element("child");
    child.addBinding(new DirectBinding("child_direct_binding", "$parent_binding + 1"); // Will call this Binding 2
    child.addBinding(new RecursiveBinding("child_recursive_binding", "10", "$child_recursive_binding + Math.PI"); // Will call this Binding 3
    parent.add(child);
    parent.initialize(); // this is where the code generation starts (top to bottom)Now the following classes are generated:
    Binding 1 expression implementation:
    public class EMC_parent_binding implements ExpressionImpl {
         public EMC_parent_binding(final BindingCache bindingCache) {
         public Object evaluate() {
              return 3.5D;
    //Binding 2 expression implementation:
    public class EMC_child_direct_binding implements ExpressionImpl {
         private Binding m_parent_binding;
         public EMC_child_direct_binding(final BindingCache bindingCache) {
              m_parent_binding = bindingCache.getBinding("parent_binding");
         public Object evaluate() {
              return (java.lang.Double)(m_parent_binding.getValue()) + 1;
    // Binding 3 expression implementation:
    public class EMC_child_recursive_binding implements ExpressionImpl {
         private boolean firstEvaluation = true;
         private Binding m_child_recursive_binding;
         public EMC_child_recursive_binding(final BindingCache bindingCache) {
              m_child_recursive_binding = bindingCache.getBinding("child_recursive_binding");
         public Object evaluate() {
              if (firstEvaluation) {
                   firstEvaluation = false;
                   return 10;
              } else {
                   return (UnkownType)(m_child_recursive_binding.getValue()) + Math.PI;  // <-------- This is where the problem appears
    }Notice the casts in the evaluate() methods. Since I cannot do operations on "Object" I needed to cast to the appropriate types. This is easy to notice in Binding 2. It's easy to cast to "java.lang.Double" since when generating the code I allready have the value of "parent_binding" and thereby know it's type.
    Now the problem appears at recursive bindings (code for Binding 3). The binding for which I currently generate the code has a value of "null" and cannot find an appropriate type to cast to. How can I find a type to cast to, or what other solutions do I have?
    I sincerely thank you for reading this whole post, and am looking forward for some replies.
    Kind regards,
    Cosmin.

Maybe you are looking for

  • Is it possible to change fonts in dropdown lists for question screens?

    I'm using Captivate 7, and creating training modules for a client with it. In these training modules, there are random quiz questions throughout. Some of these contain dropdown lists where the user will have to select choices A-D, etc. For some reaso

  • Wlan problem with my nokia e65

    please any assistance you can render for me because since yesterday i can not browse on my phone to connect to wireless is problem for me, please, please and please

  • XML parser for C 2.0.4

    Can someone from the Oracle xmlteam for the C parser please look at OTN Technical discussion XML parser for C 2.0.2 - LPX-00208 in the OTN XML Discussions? The last part of it is about 2.0.4. Thanks! John Butler

  • Is a BUG about 64bit JDK?

    public class TestThread {     public static void main(String[] args) {         IRun ir = new IRun();         Thread it = new Thread(ir);         it.start();         try {             Thread.sleep(1000);         } catch (InterruptedException ex) {    

  • LR 5.7.1 won't import

    The import function no longer recognizes ANY photos for import from my 5D mark lll.  The camera is fine.