Examples of addAnnotation()


Examples of org.drools.factmodel.FieldDefinition.addAnnotation()

                    if ( annotation != null ) {
                        try {
                            AnnotationDefinition annotationDefinition = AnnotationDefinition.build( annotation,
                                                                                                    field.getAnnotations().get( annotationName ).getValueMap(),
                                                                                                    pkgRegistry.getTypeResolver() );
                            fieldDef.addAnnotation( annotationDefinition );
                        } catch ( NoSuchMethodException nsme ) {
                            this.results.add( new TypeDeclarationError( "Annotated field " + field.getFieldName() + "  - undefined property in @annotation " + annotationName + ": " + nsme.getMessage() + ";",
                                                                        field.getLine() ) );
                        }
                    }
View Full Code Here

Examples of org.drools.lang.descr.ConstraintConnectiveDescr.addAnnotation()

                  if ( state.backtracking==0 ) {
                     if( buildDescr  ) {
                                   ConstraintConnectiveDescr descr = ConstraintConnectiveDescr.newOr();
                                   descr.addOrMerge( result );
                                   descr.addOrMerge( right );
                                   if ( args != null ) { descr.addAnnotation( args ); }
                                   result = descr;
                               }
                            
                  }
View Full Code Here

Examples of org.drools.lang.descr.RuleDescr.addAnnotation()

        final RuleBuildContext context = mock( RuleBuildContext.class );
        final Rule rule = mock( Rule.class );

        // creates input object
        final RuleDescr ruleDescr = new RuleDescr( "my rule" );
        ruleDescr.addAnnotation( "ruleId",
                                 "123" );
        ruleDescr.addAnnotation( "author",
                                 "Bob Doe" );
        ruleDescr.addAnnotation( "text",
                                 "\"It's a quoted\" string\"" );
View Full Code Here

Examples of org.drools.lang.descr.TypeDeclarationDescr.addAnnotation()

    @Test
    public void testTypeDeclaration() throws Exception {
        PackageDescr pkgDescr = new PackageDescr( "org.drools" );
        TypeDeclarationDescr typeDescr = new TypeDeclarationDescr( "StockTick" );
        typeDescr.addAnnotation( TypeDeclaration.Role.ID,
                                    "event" );
        typeDescr.addAnnotation( TypeDeclaration.ATTR_CLASS,
                                    "org.drools.StockTick" );
        pkgDescr.addTypeDeclaration( typeDescr );
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel.addAnnotation()

                            annotationMap);
                } else {
                    editor.markOccurencesHandler.removeOccurrenceAnnotations();
                    for (final Map.Entry<Annotation, Position> mapEntry : annotationMap
                            .entrySet()) {
                        annotationModel.addAnnotation(mapEntry.getKey(),
                                mapEntry.getValue());
                    }
                }
                editor.markOccurencesHandler.fOccurrenceAnnotations = annotationMap
                        .keySet().toArray(new Annotation[annotationMap.keySet().size()]);
View Full Code Here

Examples of org.eclipse.jface.text.source.projection.ProjectionAnnotationModel.addAnnotation()

      IAnnotationModel aModel = viewer.getAnnotationModel();
      for(int i=0;i<allAnnotations.length;i++) {
          AnnotationPosition ap = (AnnotationPosition)allAnnotations[i];
          Position p = new Position(ap.position().offset+offset,ap.position().length);
          if (ap.annotation() instanceof ProjectionAnnotation) {
              pModel.addAnnotation(ap.annotation(),p);
            
              // Don't collapse this in here in case there are
              // non-collapsed nested annotations
              // that haven't been added to the model yet.
              if (ap.collapsed()) {
View Full Code Here

Examples of org.exolab.castor.xml.schema.Schema.addAnnotation()

             documentation.add(text);
             documentation.add(ge);
             annotation.addDocumentation(documentation);
          }

          schema.addAnnotation(annotation);
       }
       //-- convert General Entity declarations

       // convert Element declarations
       Enumeration dtdElements = dtd.getElements();
View Full Code Here

Examples of org.exolab.javasource.JMethod.addAnnotation()

        //-- create getNameSpacePrefix method
        method = new JMethod("getNameSpacePrefix", SGTypes.STRING,
                             "the namespace prefix to use when marshaling as XML.");

        if (_config.useJava50()) {
            method.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
        }

        jsc = method.getSourceCode();
        jsc.add("return _nsPrefix;");
        addMethod(method);
View Full Code Here

Examples of org.jboss.aop.annotation.AnnotationRepository.addAnnotation()

      AnnotationRepository repository = new CachingAnnotationRepository(delegate, classLoader);
     
      Method member = beanClass.getDeclaredMethod("sayHi", String.class);
      String annotation = "javax.interceptor.Interceptors";
      String value = "@javax.interceptor.Interceptors (value={" + DummyInterceptor.class.getName() + ".class})";
      repository.addAnnotation(member, annotation, value);
     
      Interceptors interceptors = (Interceptors) repository.resolveAnnotation(member, Interceptors.class);
      assertArrayEquals(new Class[] { DummyInterceptor.class }, interceptors.value());
   }
}
View Full Code Here

Examples of org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder.addAnnotation()

            BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(hibernateStatisticsServiceName, StatisticsService.class.getName());
            StringBuffer buffer = new StringBuffer();
            buffer.append("@").append(JMX.class.getName()).append("(name=\"").append(hibernateStatisticsServiceName).append("JMX\"");
            buffer.append(", exposedInterface=").append(StatisticsServiceMBean.class.getName()).append(".class, registerDirectly=true)");
            String jmxAnnotation = buffer.toString();
            builder.addAnnotation(jmxAnnotation);
            controller.install(builder.getBeanMetaData(), hibernateStatisticsService);
         }

         // Handle JNDI binding....        
         bind();
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.