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

How to use
EnhancedAnnotation
in
org.jboss.weld.annotated.enhanced

Best Java code snippets using org.jboss.weld.annotated.enhanced.EnhancedAnnotation (Showing top 20 results out of 315)

Refine searchRefine arrow

  • ReflectionLogger
  • Arrays2
  • MetadataLogger
  • InterceptorBindingModel
  • EnhancedAnnotatedMethod
  • Reflections
  • Common ways to obtain EnhancedAnnotation
private void myMethod () {
EnhancedAnnotation e =
  • Codota IconSlimAnnotatedType annotatedType;ClassTransformer classTransformer;EnhancedAnnotationImpl.create(annotatedType, classTransformer)
  • Codota IconComputingCache computingCache;Object key;computingCache.getCastValue(key)
  • Codota IconSlimAnnotatedType annotatedType;Map map;Map annotationMap;ClassTransformer classTransformer;new EnhancedAnnotationImpl<A>(annotatedType, map, annotationMap, classTransformer)
  • Smart code suggestions by Codota
}
origin: org.jboss.weld.se/weld-se

private void checkMetaAnnotations(EnhancedAnnotation<T> annotatedAnnotation) {
  ElementType[] elementTypes = getTargetElementTypes(annotatedAnnotation.getAnnotation(Target.class));
  for (Annotation inheritedBinding : getInheritedInterceptionBindingTypes()) {
    ElementType[] metaAnnotationElementTypes = getTargetElementTypes(inheritedBinding.annotationType().getAnnotation(Target.class));
    if (!Arrays2.containsAll(metaAnnotationElementTypes, elementTypes)) {
      ReflectionLogger.LOG.invalidInterceptorBindingTargetDeclaration(inheritedBinding.annotationType().getName(),
          Arrays.toString(metaAnnotationElementTypes), annotatedAnnotation.getJavaClass().getName(), Arrays.toString(elementTypes));
    }
  }
}
origin: org.jboss.weld.se/weld-se

private void checkArrayAndAnnotationValuedMembers(EnhancedAnnotation<T> annotatedAnnotation) {
  for (EnhancedAnnotatedMethod<?, ?> annotatedMethod : annotatedAnnotation.getMembers()) {
    if ((Reflections.isArrayType(annotatedMethod.getJavaClass()) || Annotation.class.isAssignableFrom(annotatedMethod.getJavaClass()))
        && !getNonBindingMembers().contains(annotatedMethod.slim())) {
      throw MetadataLogger.LOG.nonBindingMemberTypeException(annotatedMethod);
    }
  }
}
origin: weld/core

/**
 * Validates the binding types
 */
private void checkBindings(EnhancedAnnotation<T> annotatedAnnotation) {
  Set<Annotation> bindings = annotatedAnnotation.getMetaAnnotations(Qualifier.class);
  if (bindings.size() > 0) {
    for (Annotation annotation : bindings) {
      if (!annotation.annotationType().equals(Named.class)) {
        throw MetadataLogger.LOG.qualifierOnStereotype(annotatedAnnotation);
      }
    }
  }
}
origin: weld/core

/**
 * Initializes the bean name defaulted
 */
private void initBeanNameDefaulted(EnhancedAnnotation<T> annotatedAnnotation) {
  if (annotatedAnnotation.isAnnotationPresent(Named.class)) {
    if (!"".equals(annotatedAnnotation.getAnnotation(Named.class).value())) {
      throw MetadataLogger.LOG.valueOnNamedStereotype(annotatedAnnotation);
    }
    beanNameDefaulted = true;
  }
}
origin: org.jboss.weld.se/weld-se

protected void check(EnhancedAnnotation<T> annotatedAnnotation) {
  if (valid && (!annotatedAnnotation.isAnnotationPresent(Retention.class) || annotatedAnnotation.isAnnotationPresent(Retention.class) && !annotatedAnnotation.getAnnotation(Retention.class).value().equals(RetentionPolicy.RUNTIME))) {
    this.valid = false;
    ReflectionLogger.LOG.missingRetention(annotatedAnnotation);
  }
}
origin: weld/core

@Override
protected void initValid(EnhancedAnnotation<T> annotatedAnnotation) {
  super.initValid(annotatedAnnotation);
  for (EnhancedAnnotatedMethod<?, ?> annotatedMethod : annotatedAnnotation.getMembers()) {
    if ((Reflections.isArrayType(annotatedMethod.getJavaClass()) || Annotation.class.isAssignableFrom(annotatedMethod.getJavaClass())) && !getNonBindingMembers().contains(annotatedMethod.slim())) {
      MetadataLogger.LOG.nonBindingMemberType(annotatedMethod);
      super.valid = false;
    }
  }
}
origin: org.jboss.weld.se/weld-se

@Override
protected void check(EnhancedAnnotation<T> annotatedAnnotation) {
  super.check(annotatedAnnotation);
  if (isValid()) {
    if (!annotatedAnnotation.isAnnotationPresent(Target.class)) {
      ReflectionLogger.LOG.missingTarget(annotatedAnnotation);
    } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, TYPE)) {
      ReflectionLogger.LOG.missingTargetMethodFieldType(annotatedAnnotation);
    }
  }
}
origin: org.jboss.weld.se/weld-se

protected void check(EnhancedAnnotation<T> annotatedAnnotation) {
  super.check(annotatedAnnotation);
  if (isValid()) {
    if (!annotatedAnnotation.isAnnotationPresent(Target.class)) {
      ReflectionLogger.LOG.missingTarget(annotatedAnnotation);
    }
    if (!isValidTargetType(annotatedAnnotation)) {
      ReflectionLogger.LOG.missingTargetTypeMethodOrTargetType(annotatedAnnotation);
    }
  }
}
origin: weld/core

/**
 * Validates the members
 */
protected void check(EnhancedAnnotation<T> annotatedAnnotation) {
  super.check(annotatedAnnotation);
  if (isValid()) {
    if (!annotatedAnnotation.isAnnotationPresent(Target.class)) {
      ReflectionLogger.LOG.missingTarget(annotatedAnnotation);
    } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, PARAMETER, TYPE)) {
      ReflectionLogger.LOG.missingTargetMethodFieldParameterType(annotatedAnnotation);
    }
  }
}
origin: org.jboss.weld.se/weld-se

@Override
protected void init(EnhancedAnnotation<T> annotatedAnnotation) {
  super.init(annotatedAnnotation);
  if (isValid()) {
    initInterceptionBindingTypes(annotatedAnnotation);
    checkArrayAndAnnotationValuedMembers(annotatedAnnotation);
    checkMetaAnnotations(annotatedAnnotation);
    this.metaAnnotations = annotatedAnnotation.getAnnotations();
  }
}
origin: weld/core

@Override
protected void check(EnhancedAnnotation<T> annotatedAnnotation) {
  super.check(annotatedAnnotation);
  if (isValid()) {
    if (!annotatedAnnotation.isAnnotationPresent(Target.class)) {
      ReflectionLogger.LOG.missingTarget(annotatedAnnotation);
    } else {
      ElementType[] elementTypes = annotatedAnnotation.getAnnotation(Target.class).value();
      if (!(Arrays2.unorderedEquals(elementTypes, METHOD, FIELD, TYPE) ||
          Arrays2.unorderedEquals(elementTypes, TYPE) ||
          Arrays2.unorderedEquals(elementTypes, METHOD) ||
          Arrays2.unorderedEquals(elementTypes, FIELD) ||
          Arrays2.unorderedEquals(elementTypes, METHOD, TYPE)
      )) {
        ReflectionLogger.LOG.missingTargetMethodFieldTypeParameterOrTargetMethodTypeOrTargetMethodOrTargetTypeOrTargetField(annotatedAnnotation);
      }
    }
  }
}
origin: org.jboss.weld.se/weld-se

protected void initNonBindingMembers(EnhancedAnnotation<T> annotatedAnnotation) {
  Set<EnhancedAnnotatedMethod<?, ?>> enhancedMethods = annotatedAnnotation.getMembers(Nonbinding.class);
  if (enhancedMethods.isEmpty()) {
    this.nonBindingMembers = Collections.emptySet();
  } else {
    Set<AnnotatedMethod<?>> nonBindingMembers = new HashSet<AnnotatedMethod<?>>();
    for (EnhancedAnnotatedMethod<?, ?> method : enhancedMethods) {
      nonBindingMembers.add(method.slim());
    }
    this.nonBindingMembers = immutableSetView(nonBindingMembers);
  }
}
origin: weld/core

/**
 * Initializes the default scope type
 */
private void initDefaultScopeType(EnhancedAnnotation<T> annotatedAnnotation) {
  Set<Annotation> scopeTypes = new HashSet<Annotation>();
  scopeTypes.addAll(annotatedAnnotation.getMetaAnnotations(Scope.class));
  scopeTypes.addAll(annotatedAnnotation.getMetaAnnotations(NormalScope.class));
  if (scopeTypes.size() > 1) {
    throw MetadataLogger.LOG.multipleScopes(annotatedAnnotation);
  } else if (scopeTypes.size() == 1) {
    this.defaultScopeType = scopeTypes.iterator().next();
  }
}
origin: weld/core

private static boolean isValidTargetType(EnhancedAnnotation<?> annotation) {
  Target target = annotation.getAnnotation(Target.class);
  return target != null
      && (Arrays2.unorderedEquals(target.value(), ElementType.TYPE, ElementType.METHOD) || Arrays2.unorderedEquals(target.value(), ElementType.TYPE));
}
origin: weld/core

/**
 * Initializes the interceptor bindings
 */
private void initInterceptorBindings(EnhancedAnnotation<T> annotatedAnnotation) {
  interceptorBindings = annotatedAnnotation.getMetaAnnotations(InterceptorBinding.class);
}
origin: weld/core

/**
 * Constructor
 *
 * @param type The annotation type
 */
public AnnotationModel(EnhancedAnnotation<T> enhancedAnnotatedAnnotation) {
  this.annotatedAnnotation = enhancedAnnotatedAnnotation.slim();
  init(enhancedAnnotatedAnnotation);
}
origin: org.jboss.weld.se/weld-se

@Override
protected void init(EnhancedAnnotation<T> annotatedAnnotation) {
  super.init(annotatedAnnotation);
  if (valid) {
    initAlternative(annotatedAnnotation);
    initDefaultScopeType(annotatedAnnotation);
    initBeanNameDefaulted(annotatedAnnotation);
    initInterceptorBindings(annotatedAnnotation);
    initInheritedStereotypes(annotatedAnnotation);
    checkBindings(annotatedAnnotation);
    this.metaAnnotations = annotatedAnnotation.getAnnotations();
  }
}
origin: org.jboss.weld.se/weld-se

public Set<EnhancedAnnotatedMethod<?, ?>> getMembers() {
  return delegate().getMembers();
}
origin: org.jboss.weld.se/weld-se

@Override
protected void initValid(EnhancedAnnotation<T> annotatedAnnotation) {
  super.initValid(annotatedAnnotation);
  for (EnhancedAnnotatedMethod<?, ?> annotatedMethod : annotatedAnnotation.getMembers()) {
    if ((Reflections.isArrayType(annotatedMethod.getJavaClass()) || Annotation.class.isAssignableFrom(annotatedMethod.getJavaClass())) && !getNonBindingMembers().contains(annotatedMethod.slim())) {
      MetadataLogger.LOG.nonBindingMemberType(annotatedMethod);
      super.valid = false;
    }
  }
}
origin: weld/core

@Override
protected void check(EnhancedAnnotation<T> annotatedAnnotation) {
  super.check(annotatedAnnotation);
  if (isValid()) {
    if (!annotatedAnnotation.isAnnotationPresent(Target.class)) {
      ReflectionLogger.LOG.missingTarget(annotatedAnnotation);
    } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, TYPE)) {
      ReflectionLogger.LOG.missingTargetMethodFieldType(annotatedAnnotation);
    }
  }
}
org.jboss.weld.annotated.enhancedEnhancedAnnotation

Javadoc

Represents a meta annotation

Most used methods

  • getAnnotation
  • getAnnotations
  • getJavaClass
  • getMembers
    Gets all the members annotated with annotationType
  • getMetaAnnotations
  • isAnnotationPresent
  • slim

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Notification (javax.management)
  • JTextField (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
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