Examples of TypeMirror


Examples of javax.lang.model.type.TypeMirror

            .toAttributes();
    }

    @Override
    protected Type getSuperClass() {
        TypeMirror type = operatorClass.getElement().asType();
        return util.t(type);
    }
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

        Precondition.checkMustNotBeNull(processor, "processor"); //$NON-NLS-1$
        Class<? extends Annotation> target = processor.getTargetAnnotationType();
        assert target != null;
        TypeElement annotation = environment.getElementUtils().getTypeElement(target.getCanonicalName());
        assert annotation != null;
        TypeMirror annotationType = annotation.asType();

        Set<? extends Element> elements = round.getElementsAnnotatedWith(annotation);
        for (Element element : elements) {
            ExecutableElement method = toOperatorMethodElement(element);
            if (method == null) {
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

        return targetOperatorAnnotation;
    }

    @Override
    public synchronized AnnotationMirror getOperatorAnnotation(ExecutableElement element) {
        TypeMirror targetType = environment
                .getElementUtils()
                .getTypeElement(targetOperatorAnnotation.getName())
                .asType();
        Types types = environment.getTypeUtils();
        for (AnnotationMirror annotation : element.getAnnotationMirrors()) {
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

                    "マスタ選択を行うメソッド{0}の戻り値は、{1}のサブタイプでなければなりません",
                    selectorMethod.getSimpleName(),
                    operatorMaster));
        }
        for (int i = 2, n = selectorParams.size(); i < n; i++) {
            TypeMirror expected = operatorParams.get(i).asType();
            TypeMirror actual = selectorParams.get(i).asType();
            if (environment.getTypeUtils().isSubtype(expected, actual) == false) {
                throw new ResolveException(MessageFormat.format(
                        "マスタ選択を行うメソッド{0}の{2}つめの引数は、{1}のスーパータイプでなければなりません",
                        selectorMethod.getSimpleName(),
                        expected,
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

            ExecutableElement selectorMethod,
            TypeMirror firstParameter) throws ResolveException {
        assert environment != null;
        assert selectorMethod != null;
        assert firstParameter != null;
        TypeMirror erasedSelector = environment.getErasure(firstParameter);
        Types types = environment.getTypeUtils();
        if (types.isSameType(erasedSelector, environment.getDeclaredType(List.class)) == false) {
            throw new ResolveException(MessageFormat.format(
                    "マスタ選択を行うメソッド{0}の1つめの引数は、List<...>の形式でなければなりません",
                    selectorMethod.getSimpleName()));
        }
        DeclaredType list = (DeclaredType) firstParameter;
        if (list.getTypeArguments().size() != 1) {
            throw new ResolveException(MessageFormat.format(
                    "マスタ選択を行うメソッド{0}の1つめの引数は、List<...>の形式でなければなりません",
                    selectorMethod.getSimpleName()));
        }
        TypeMirror selectorElement = list.getTypeArguments().get(0);
        return environment.loadDataModel(selectorElement);
    }
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

                a.getParameterName(0),
                a.getParameterType(0).getType(),
                0);
        for (int i = 1; i < startParameters; i++) {
            TypeConstraint outputType = a.getParameterType(i).getTypeArgument();
            TypeMirror outputTypeMirror = outputType.getType();
            String found = builder.findInput(outputTypeMirror);
            if (found == null && outputType.isProjectiveModel()) {
                a.error("出力型{0}に対する入力が見つかりません", outputTypeMirror);
            }
            builder.addOutput(
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

                a.getParameterType(0).getTypeArgument().getType(),
                0,
                key);
        for (int i = 1; i < startParameters; i++) {
            TypeConstraint outputType = a.getParameterType(i).getTypeArgument();
            TypeMirror outputTypeMirror = outputType.getType();
            String found = builder.findInput(outputTypeMirror);
            if (found == null && outputType.isProjectiveModel()) {
                a.error("出力型{0}に対する入力が見つかりません", outputTypeMirror);
            }
            builder.addOutput(
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

                    || modifiers.contains(Modifier.STATIC) == false
                    || modifiers.contains(Modifier.FINAL) == false) {
                return false;
            }
            VariableElement variable = (VariableElement) member;
            TypeMirror constantType = variable.asType();
            if (constantType.getKind() != TypeKind.DECLARED) {
                return false;
            }
            Types types = environment.getTypeUtils();
            return types.isSameType(constantType, type);
        }
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

                    || (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;
            }
            if (environment.getTypeUtils().isSameType(a, fromType)) {
                return environment.getTypeUtils().isSameType(b, joinType);
View Full Code Here

Examples of javax.lang.model.type.TypeMirror

                    || 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
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.