Package org.drools.lang.descr

Examples of org.drools.lang.descr.TypeFieldDescr


    @Test
    public void testTypeDeclarationNewBean() throws Exception {
        PackageDescr pkgDescr = new PackageDescr( "org.test" );
        TypeDeclarationDescr typeDescr = new TypeDeclarationDescr( "NewBean" );

        TypeFieldDescr f1 = new TypeFieldDescr( "name",
                                                new PatternDescr( "String" ) );
        TypeFieldDescr f2 = new TypeFieldDescr( "age",
                                                new PatternDescr( "int" ) );

        typeDescr.addField( f1 );
        typeDescr.addField( f2 );
View Full Code Here


            td.setTypeName( className );

            for ( Map.Entry<String, MethodSignature> e : methodSignatures.entrySet() ) {
                if ( e.getValue().accessorAndMutator == FieldAccessorsAndMutators.BOTH ) {
                    String fieldShortName = getShortNameOfClass( e.getKey() );
                    TypeFieldDescr fieldDescr = new TypeFieldDescr( fieldShortName );
                    PatternDescr patternDescr = new PatternDescr( e.getValue().returnType.getName() );
                    fieldDescr.setPattern( patternDescr );
                    td.addField( fieldDescr );
                }
            }
            return td;
View Full Code Here

      Map<String, TypeFieldDescr> fields = td.getFields();
      for (Iterator<Map.Entry<String, TypeFieldDescr>> iterator = fields.entrySet().iterator(); iterator.hasNext();) {
        Map.Entry<String, TypeFieldDescr> en = iterator.next();
        String fieldName = en.getKey();
        TypeFieldDescr descr = en.getValue();
        if (descr.getMetaAttributes().size() > 0) {
          //can't do this yet
          throw new DroolsParserException("using text");
        }
        FieldMetaModel fm = new FieldMetaModel(fieldName, descr.getPattern().getObjectType());

        mm.fields.add(fm);
      }
      list.add(mm);
    }
View Full Code Here

        TypeDeclarationDescr declaration = null;

        DroolsTree id=null;
        Map dm = null;

        TypeFieldDescr df = null;


          List<Map> declMetadaList = new LinkedList<Map>();
            List<TypeFieldDescr> declFieldList = new LinkedList<TypeFieldDescr>();
        try {
View Full Code Here


    // $ANTLR start "decl_field"
    // /Users/porcelli/Documents/dev/drools-trunk/drools-compiler/src/main/resources/org/drools/lang/DescrBuilderTree.g:183:1: decl_field returns [TypeFieldDescr fieldDescr] : ^(id= ID (init= decl_field_initialization )? dt= data_type (dm= decl_metadata )* ) ;
    public final TypeFieldDescr decl_field() throws RecognitionException {
        TypeFieldDescr fieldDescr = null;

        DroolsTree id=null;
        String init = null;

        BaseDescr dt = null;
View Full Code Here

TOP

Related Classes of org.drools.lang.descr.TypeFieldDescr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.