Package javax.lang.model.element

Examples of javax.lang.model.element.AnnotationMirror


        for (Element element : elements) {
            ExecutableElement method = toOperatorMethodElement(element);
            if (method == null) {
                continue;
            }
            AnnotationMirror annotationMirror = findAnnotation(annotationType, method);
            if (annotationMirror == null) {
                raiseInvalid(element, "演算子{0}の注釈を正しく解析できませんでした");
                continue;
            }
            registerMethod(annotationMirror, processor, method);
View Full Code Here


         * @param a 結合する型
         * @param b 結合する型
         * @return この型が結合モデルを表現する場合のみ{@code true}
         */
        public boolean isJoinedModel(TypeMirror a, TypeMirror b) {
            AnnotationMirror annotation = findAnnotation(element, environment.getDeclaredType(Joined.class));
            if (annotation == null) {
                return false;
            }
            Map<String, AnnotationValue> values = getValues(annotation);
            List<? extends AnnotationValue> terms = getList(values, "terms");
            if (terms == null
                    || terms.size() != 2
                    || (terms.get(0).getValue() instanceof AnnotationMirror) == false
                    || (terms.get(1).getValue() instanceof AnnotationMirror) == false) {
                return false;
            }
            AnnotationMirror from = (AnnotationMirror) terms.get(0).getValue();
            AnnotationMirror join = (AnnotationMirror) terms.get(1).getValue();
            TypeMirror fromType = getReduceTermType(from);
            TypeMirror joinType = getReduceTermType(join);
            if (fromType == null || joinType == null) {
                return false;
            }
View Full Code Here

         * @param target 対象の型
         * @return この型が結合モデルを表現する場合のみ{@code true}
         */
        public boolean isJoinFrom(TypeMirror target) {
            Precondition.checkMustNotBeNull(target, "target"); //$NON-NLS-1$
            AnnotationMirror annotation = findAnnotation(element, environment.getDeclaredType(Joined.class));
            if (annotation == null) {
                return false;
            }
            Map<String, AnnotationValue> values = getValues(annotation);
            List<? extends AnnotationValue> terms = getList(values, "terms");
            if (terms == null
                    || terms.isEmpty()
                    || (terms.get(0).getValue() instanceof AnnotationMirror) == false) {
                return false;
            }
            AnnotationMirror from = (AnnotationMirror) terms.get(0).getValue();
            TypeMirror fromType = getReduceTermType(from);
            if (fromType == null) {
                return false;
            }
            return typeEqual(fromType, target);
View Full Code Here

         * @throws IllegalArgumentException 引数に{@code null}が指定された場合
         */
        public ShuffleKey getJoinKey(TypeMirror target) {
            Precondition.checkMustNotBeNull(target, "target"); //$NON-NLS-1$
            DataModelMirror model = environment.loadDataModel(target);
            AnnotationMirror annotation = findAnnotation(element, environment.getDeclaredType(Joined.class));
            if (model == null || annotation == null) {
                throw new IllegalArgumentException();
            }
            Map<String, AnnotationValue> values = getValues(annotation);
            List<? extends AnnotationValue> terms = getList(values, "terms");
            if (terms == null) {
                throw new IllegalArgumentException();
            }
            for (AnnotationValue value : terms) {
                if ((value.getValue() instanceof AnnotationMirror) == false) {
                    continue;
                }
                AnnotationMirror term = (AnnotationMirror) value.getValue();
                if (typeEqual(target, getReduceTermType(term))) {
                    AnnotationMirror shuffle = getReduceTermKey(term);
                    ShuffleKey key = toShuffleKey(-1, model, shuffle);
                    return key;
                }
            }
            throw new IllegalArgumentException();
View Full Code Here

         * @return この型が集計モデルを表現する場合のみ{@code true}
         * @throws IllegalArgumentException 引数に{@code null}が指定された場合
         */
        public boolean isSummarizedModel(TypeMirror target) {
            Precondition.checkMustNotBeNull(target, "target"); //$NON-NLS-1$
            AnnotationMirror annotation = findAnnotation(element, environment.getDeclaredType(Summarized.class));
            if (annotation == null) {
                return false;
            }
            Map<String, AnnotationValue> values = getValues(annotation);
            AnnotationMirror from = getValue(AnnotationMirror.class, values, "term");
            if (from == null) {
                return false;
            }
            TypeMirror fromType = getReduceTermType(from);
            if (fromType == null) {
View Full Code Here

         * この型が集約をモデルを表す場合に、指定の型に関する結合キーを返す。
         * @return 集約キー
         * @throws IllegalArgumentException 引数に{@code null}が指定された場合
         */
        public ShuffleKey getSummarizeKey() {
            AnnotationMirror annotation = findAnnotation(element, environment.getDeclaredType(Summarized.class));
            if (annotation == null) {
                throw new IllegalArgumentException();
            }
            Map<String, AnnotationValue> values = getValues(annotation);
            AnnotationMirror reduce = getValue(AnnotationMirror.class, values, "term");
            if (reduce == null) {
                throw new IllegalArgumentException();
            }
            TypeMirror shuffleType = getReduceTermType(reduce);
            DataModelMirror model = environment.loadDataModel(shuffleType);
            AnnotationMirror shuffleKey = getReduceTermKey(reduce);
            if (model != null && shuffleKey != null) {
                return toShuffleKey(-1, model, shuffleKey);
            }
            throw new IllegalArgumentException();
        }
View Full Code Here

   */
  public static AnnotationMirror getAnnotationMirror(Element element, Class<? extends Annotation> clazz) {
    assert element != null;
    assert clazz != null;

    AnnotationMirror mirror = null;
    for ( AnnotationMirror am : element.getAnnotationMirrors() ) {
      if ( isAnnotationMirrorOfType( am, clazz ) ) {
        mirror = am;
        break;
      }
View Full Code Here

      for ( Element subElement : myMembers ) {
        List<? extends AnnotationMirror> entityAnnotations =
            context.getProcessingEnvironment().getElementUtils().getAllAnnotationMirrors( subElement );

        for ( Object entityAnnotation : entityAnnotations ) {
          AnnotationMirror annotationMirror = ( AnnotationMirror ) entityAnnotation;

          //FIXME consider XML
          if ( TypeUtils.isAnnotationMirrorOfType( annotationMirror, Id.class )
              || TypeUtils.isAnnotationMirrorOfType( annotationMirror, EmbeddedId.class ) ) {
            context.logMessage( Diagnostic.Kind.OTHER, "Found id on" + searchedElement );
View Full Code Here

    }
    return forcedAccessType;
  }

  private AccessType determineAnnotationSpecifiedAccessType(Element element) {
    final AnnotationMirror accessAnnotationMirror = TypeUtils.getAnnotationMirror( element, Access.class );
    AccessType forcedAccessType = null;
    if ( accessAnnotationMirror != null ) {
      Element accessElement = ( Element ) TypeUtils.getAnnotationValue(
          accessAnnotationMirror,
          DEFAULT_ANNOTATION_PARAMETER_NAME
View Full Code Here

    TypeElement component = (TypeElement)value.asElement();
    components.add(component);
   
    // scan for UseSetter
    String setterMethod = null;
    AnnotationMirror setterMirror = ProcessorUtil.mirror(UseSetter.class, method);
    if (setterMirror != null) {
      AnnotationValue setter = readAnnotationField(setterMirror, "value");
      setterMethod = (setter != null)
          ? (String)setter.getValue()
          : method.getSimpleName().toString();
View Full Code Here

TOP

Related Classes of javax.lang.model.element.AnnotationMirror

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.