Codota Logo
AnnotationDescr
Code IndexAdd Codota to your IDE (free)

How to use
AnnotationDescr
in
org.drools.lang.descr

Best Java code snippets using org.drools.lang.descr.AnnotationDescr (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

protected void processMetadataAnnotations(Pattern pattern, Map<String, AnnotationDescr> annotationMap) {
  for ( String key : annotationMap.keySet() ) {
    if ( ! Pattern.ATTR_LISTENED_PROPS.equals( key ) ) {
      AnnotationDescr ann = annotationMap.get( key );
      AnnotationDefinition def = new AnnotationDefinition( key );
      for ( String propKey : ann.getValues().keySet() ) {
        def.getValues().put( propKey, new AnnotationDefinition.AnnotationPropertyVal( propKey, null, ann.getValue( propKey ), null ) );
      }
      pattern.getAnnotations().put( key, def );
    }
  }        
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

/**
 * Assigns a new annotation to this type with the respective name and value
 * @param name
 * @param value
 * @return returns the previous value of this annotation
 */
public AnnotationDescr addAnnotation( String name,
                   String value ) {
  if ( this.annotations == null ) {
    this.annotations = new HashMap<String, AnnotationDescr>();
  }
  AnnotationDescr annotation = new AnnotationDescr( name,
                           value );
  return this.annotations.put( annotation.getName(),
                 annotation );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

/**
 * Returns the metadata value as a single object or a Map
 * @return
 */
public Object getValue() {
  Object single = getSingleValue();
  return single != null ? single : this.values;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public Object getValueStripped() {
  Object single = getSingleValueStripped();
  if( single != null ) return single;
  Map<String,String> sMap = new HashMap<String,String>();
  for( Map.Entry<String,String> entry: this.values.entrySet() ){
    sMap.put( entry.getKey(), unquote( entry.getValue() ) );
  }        
  return sMap;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void buildMetaAttributes(final RuleBuildContext context ) {
  Rule rule = context.getRule();
  for ( String metaAttr : context.getRuleDescr().getAnnotationNames() ) {
    AnnotationDescr ad = context.getRuleDescr().getAnnotation( metaAttr );
    if ( ad.hasValue() ) {
      if ( ad.getValues().size() == 1 ) {
        rule.addMetaAttribute( metaAttr,
                    resolveValue( ad.getSingleValue() ) );
      } else {
        rule.addMetaAttribute( metaAttr,
                    ad.getValueMap() );
      }
    } else {
      rule.addMetaAttribute( metaAttr,
                  null );
    }
  }
}
origin: org.drools/droolsjbpm-ide-common

AnnotationDescr annotation = typeDeclarationDescr.getAnnotation( annotationName );
annotations.put( annotationName,
         annotation.getValues() );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

    interfaces );
def.setTraitable( traitable, traitableAnn != null &&
               traitableAnn.getValue( "logical" ) != null &&
               Boolean.valueOf( traitableAnn.getValue( "logical" ) ) );
try {
  AnnotationDefinition annotationDefinition = AnnotationDefinition.build( annotation,
                                      typeDescr.getAnnotations().get( annotationName ).getValueMap(),
                                      pkgRegistry.getTypeResolver() );
  def.addAnnotation( annotationDefinition );
def.addMetaData( annotationName, typeDescr.getAnnotation( annotationName ).getSingleValue() );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

try {
  AnnotationDefinition annotationDefinition = AnnotationDefinition.build( annotation,
                                      field.getAnnotations().get( annotationName ).getValueMap(),
                                      pkgRegistry.getTypeResolver() );
  fieldDef.addAnnotation( annotationDefinition );
fieldDef.addMetaData( annotationName, field.getAnnotation( annotationName ).getSingleValue() );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

protected TypeFieldDescr buildInheritedFieldDescrFromDefinition( FactField fld, TypeDeclarationDescr typeDescr ) {
  PatternDescr fldType = new PatternDescr();
  TypeFieldDescr inheritedFldDescr = new TypeFieldDescr();
    inheritedFldDescr.setFieldName( fld.getName() );
    fldType.setObjectType( ( (FieldDefinition) fld ).getFieldAccessor().getExtractToClassName() );
    inheritedFldDescr.setPattern( fldType );
  if ( fld.isKey() ) {
    inheritedFldDescr.getAnnotations().put( TypeDeclaration.ATTR_KEY,
                        new AnnotationDescr( TypeDeclaration.ATTR_KEY ) );
  }
    inheritedFldDescr.setIndex( ( (FieldDefinition) fld ).getDeclIndex() );
    inheritedFldDescr.setInherited( true );
    String initExprOverride = ( (FieldDefinition) fld ).getInitExpr();
    int overrideCount = 0;
    // only @aliasing local fields may override defaults.
    for ( TypeFieldDescr localField : typeDescr.getFields().values() ) {
      AnnotationDescr ann = localField.getAnnotation( "Alias" );
      if ( ann != null && fld.getName().equals( ann.getSingleValue().replaceAll( "\"", "" ) ) && localField.getInitExpr() != null ) {
        overrideCount++;
        initExprOverride = localField.getInitExpr();
      }
    }
    if ( overrideCount > 1 ) {
      // however, only one is allowed
      initExprOverride = null;
    }
    inheritedFldDescr.setInitExpr( initExprOverride );
  return inheritedFldDescr;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public AnnotationDescrBuilder<P> keyValue( String key,
                      String value ) {
  descr.setKeyValue( key,
            value );
  return this;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

protected AnnotationDescrBuilderImpl(P parent,
                   String name) {
  super( parent,
      new AnnotationDescr( name ) );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

for (String propertyName : listenedProps.getValue().toString().split(",")) {
  propertyName = propertyName.trim();
  if (propertyName.equals("*") || propertyName.equals("!*")) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

/**
 * Assigns a new annotation to this type
 * @param annotation
 * @return returns the previous value of this annotation
 */
public AnnotationDescr addAnnotation( AnnotationDescr annotation ) {
  if ( this.annotations == null ) {
    this.annotations = new HashMap<String, AnnotationDescr>();
  }
  return this.annotations.put( annotation.getName(),
                 annotation );
}
origin: org.chtijbug.drools/droolsjbpm-ide-common

AnnotationDescr annotation = typeDeclarationDescr.getAnnotation( annotationName );
annotations.put( annotationName,
         annotation.getValues() );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public final void annotationElementValuePair(AnnotationDescr descr) throws RecognitionException {
  Token key=null;
  DRLExpressions.annotationValue_return val = null;
  try {
    // src/main/resources/org/drools/lang/DRLExpressions.g:201:3: (key= ID EQUALS_ASSIGN val= annotationValue )
    // src/main/resources/org/drools/lang/DRLExpressions.g:201:5: key= ID EQUALS_ASSIGN val= annotationValue
    {
    key=(Token)match(input,ID,FOLLOW_ID_in_annotationElementValuePair1023); if (state.failed) return ;
    match(input,EQUALS_ASSIGN,FOLLOW_EQUALS_ASSIGN_in_annotationElementValuePair1025); if (state.failed) return ;
    pushFollow(FOLLOW_annotationValue_in_annotationElementValuePair1029);
    val=annotationValue();
    state._fsp--;
    if (state.failed) return ;
    if ( state.backtracking==0 ) {
      if ( buildDescr ) { descr.setKeyValue( (key!=null?key.getText():null), (val!=null?input.toString(val.start,val.stop):null) ); } 
    }
    }
  }
  catch (RecognitionException re) {
    throw re;
  }
  finally {
  }
  return ;
}
// $ANTLR end "annotationElementValuePair"
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

if( buildDescr ) { result = inDescrBuilder != null ? (AnnotationDescr) inDescrBuilder.newAnnotation( n ).getDescr() : new AnnotationDescr( n ); } 
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

if ( ann != null && !StringUtils.isEmpty( (String) ann.getValue() ) ) {
  rule.setActivationListener( MVEL.evalToString( (String) ann.getValue() ) );
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public FieldDescrBuilder processAnnotations() {
  if ( descr.getAnnotations().containsKey( TypeDeclaration.ATTR_FIELD_POSITION ) ) {
     int pos = Integer.valueOf(descr.getAnnotation( TypeDeclaration.ATTR_FIELD_POSITION ).getSingleValue());
     descr.setIndex(pos);
  }
  return this;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

String role = ( annotationDescr != null ) ? annotationDescr.getSingleValue() : null;
if (role != null) {
  type.setRole( TypeDeclaration.Role.parseRole( role ) );
String typesafe = ( annotationDescr != null ) ? annotationDescr.getSingleValue() : null;
if (typesafe != null) {
  type.setTypesafe( Boolean.parseBoolean( typesafe ) );
String format = ( annotationDescr != null ) ? annotationDescr.getSingleValue() : null;
if (format != null) {
  type.setFormat( TypeDeclaration.Format.parseFormat( format ) );
String kind = (annotationDescr != null) ? annotationDescr.getSingleValue() : null;
if ( kind != null ) {
  type.setKind( TypeDeclaration.Kind.parseKind( kind ) );
String className = ( annotationDescr != null ) ? annotationDescr.getSingleValue() : null;
if (StringUtils.isEmpty( className )) {
  className = type.getTypeName();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

String timestamp = ( annotationDescr != null ) ? annotationDescr.getSingleValue() : null;
if (timestamp != null) {
  type.setTimestampAttribute( timestamp );
String duration = ( annotationDescr != null ) ? annotationDescr.getSingleValue() : null;
if (duration != null) {
  type.setDurationAttribute( duration );
String expiration = ( annotationDescr != null ) ? annotationDescr.getSingleValue() : null;
if (expiration != null) {
  if (timeParser == null) {
org.drools.lang.descrAnnotationDescr

Most used methods

  • getValues
  • <init>
  • getName
  • getSingleValue
  • getSingleValueStripped
  • getValue
  • getValueMap
  • hasValue
  • setKeyValue
  • setValue
  • unquote
  • unquote

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Collectors (java.util.stream)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now