Examples of AnnotationDescrBuilder


Examples of org.drools.compiler.lang.api.AnnotationDescrBuilder


    Token name=null;
    Token x=null;

     String n = ""; AnnotationDescrBuilder annoBuilder = null;
    try {
      // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:182:3: ( AT name= ID ( DOT x= ID )* annotationArgs[result, annoBuilder] )
      // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:182:5: AT name= ID ( DOT x= ID )* annotationArgs[result, annoBuilder]
      {
      match(input,AT,FOLLOW_AT_in_fullAnnotation894); if (state.failed) return result;
      name=(Token)match(input,ID,FOLLOW_ID_in_fullAnnotation898); if (state.failed) return result;
      if ( state.backtracking==0 ) { n = (name!=null?name.getText():null); }
      // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:182:36: ( DOT x= ID )*
      loop18:
      while (true) {
        int alt18=2;
        int LA18_0 = input.LA(1);
        if ( (LA18_0==DOT) ) {
          alt18=1;
        }

        switch (alt18) {
        case 1 :
          // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:182:38: DOT x= ID
          {
          match(input,DOT,FOLLOW_DOT_in_fullAnnotation904); if (state.failed) return result;
          x=(Token)match(input,ID,FOLLOW_ID_in_fullAnnotation908); if (state.failed) return result;
          if ( state.backtracking==0 ) { n += "." + (x!=null?x.getText():null); }
          }
          break;

        default :
          break loop18;
        }
      }

      if ( state.backtracking==0 ) { if( buildDescr ) {
                      if ( inDescrBuilder == null ) {
                          result = new AnnotationDescr( n );
                      } else {
                          annoBuilder = inDescrBuilder instanceof AnnotationDescrBuilder ?
                              ((AnnotationDescrBuilder) inDescrBuilder).newAnnotation( n ) : inDescrBuilder.newAnnotation( n );
                          result = (AnnotationDescr) annoBuilder.getDescr();
                      }
                  }
              }
      pushFollow(FOLLOW_annotationArgs_in_fullAnnotation929);
      annotationArgs(result, annoBuilder);
View Full Code Here

Examples of org.drools.compiler.lang.api.AnnotationDescrBuilder

        private AnnotatedBaseDescr descr = new AnnotatedBaseDescr();

        @Override
        public AnnotationDescrBuilder newAnnotation(String name) {
            AnnotationDescrBuilder annotation = new AnnotationDescrCreator( name );
            descr.addAnnotation((AnnotationDescr) annotation.getDescr());
            return annotation;
        }
View Full Code Here

Examples of org.drools.compiler.lang.api.AnnotationDescrBuilder

        }

        public void setAnnotationsOn(AnnotatedDescrBuilder builder) {
            if (!descr.getAnnotations().isEmpty()) {
                for (AnnotationDescr annDescr : descr.getAnnotations()) {
                    AnnotationDescrBuilder annotation = builder.newAnnotation(annDescr.getName());
                    for (Map.Entry<String, Object> valueEntry : annDescr.getValueMap().entrySet()) {
                        annotation.keyValue(valueEntry.getKey(), valueEntry.getValue());
                    }
                }
                clear();
            }
        }
View Full Code Here

Examples of org.drools.lang.api.AnnotationDescrBuilder

                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return;

            AnnotationDescrBuilder annotation = null;
            if ( state.backtracking == 0 ) {
                annotation = adb.newAnnotation( id.getText() );
                helper.setStart( annotation,
                                 at );
                helper.pushBuilderContext( annotation );
            }

            try {
                if ( input.LA( 1 ) == DRLLexer.LEFT_PAREN ) {
                    if ( speculateElementValuePairs() ) {
                        elementValuePairs( annotation );
                        if ( state.failed ) return;
                    } else {
                        String value = chunk( DRLLexer.LEFT_PAREN,
                                              DRLLexer.RIGHT_PAREN,
                                              -1 ).trim();
                        if ( state.failed ) return;
                        if ( state.backtracking == 0 ) {
                            if ( value.startsWith( "\"" ) && value.endsWith( "\"" ) ) {
                                value = StringUtils.unescapeJava( value );
                            }
                            annotation.value( value );
                        }
                    }
                }
            } finally {
                if ( state.backtracking == 0 ) {
View Full Code Here

Examples of org.drools.lang.api.AnnotationDescrBuilder

                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return;

            AnnotationDescrBuilder annotation = null;
            if ( state.backtracking == 0 ) {
                annotation = adb.newAnnotation( id.getText() );
                helper.setStart( annotation,
                                 at );
                helper.pushBuilderContext( annotation );
            }

            try {
                if ( input.LA( 1 ) == DRLLexer.LEFT_PAREN ) {
                    if ( speculateElementValuePairs() ) {
                        elementValuePairs( annotation );
                        if ( state.failed ) return;
                    } else {
                        String value = chunk( DRLLexer.LEFT_PAREN,
                                              DRLLexer.RIGHT_PAREN,
                                              -1 ).trim();
                        if ( state.failed ) return;
                        if ( state.backtracking == 0 ) {
                            if ( value.startsWith( "\"" ) && value.endsWith( "\"" ) ) {
                                value = StringUtils.unescapeJava( value );
                            }
                            annotation.value( value );
                        }
                    }
                }
            } finally {
                if ( state.backtracking == 0 ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.