Search in sources :

Example 6 with Annotation

use of com.google.devtools.j2objc.ast.Annotation in project j2objc by google.

the class TypeDeclarationGenerator method hasDeprecated.

private boolean hasDeprecated(List<Annotation> annotations) {
    for (Annotation annotation : annotations) {
        Name annotationTypeName = annotation.getTypeName();
        String expectedTypeName = annotationTypeName.isQualifiedName() ? "java.lang.Deprecated" : "Deprecated";
        if (expectedTypeName.equals(annotationTypeName.getFullyQualifiedName())) {
            return true;
        }
    }
    return false;
}
Also used : PropertyAnnotation(com.google.devtools.j2objc.ast.PropertyAnnotation) Annotation(com.google.devtools.j2objc.ast.Annotation) Name(com.google.devtools.j2objc.ast.Name)

Aggregations

Annotation (com.google.devtools.j2objc.ast.Annotation)6 PropertyAnnotation (com.google.devtools.j2objc.ast.PropertyAnnotation)3 SingleMemberAnnotation (com.google.devtools.j2objc.ast.SingleMemberAnnotation)3 MarkerAnnotation (com.google.devtools.j2objc.ast.MarkerAnnotation)2 NormalAnnotation (com.google.devtools.j2objc.ast.NormalAnnotation)2 AbstractTypeDeclaration (com.google.devtools.j2objc.ast.AbstractTypeDeclaration)1 AnnotatableType (com.google.devtools.j2objc.ast.AnnotatableType)1 ArrayType (com.google.devtools.j2objc.ast.ArrayType)1 CastExpression (com.google.devtools.j2objc.ast.CastExpression)1 CompilationUnit (com.google.devtools.j2objc.ast.CompilationUnit)1 ConditionalExpression (com.google.devtools.j2objc.ast.ConditionalExpression)1 Expression (com.google.devtools.j2objc.ast.Expression)1 FunctionalExpression (com.google.devtools.j2objc.ast.FunctionalExpression)1 InfixExpression (com.google.devtools.j2objc.ast.InfixExpression)1 InstanceofExpression (com.google.devtools.j2objc.ast.InstanceofExpression)1 IntersectionType (com.google.devtools.j2objc.ast.IntersectionType)1 LambdaExpression (com.google.devtools.j2objc.ast.LambdaExpression)1 MemberValuePair (com.google.devtools.j2objc.ast.MemberValuePair)1 Name (com.google.devtools.j2objc.ast.Name)1 NameQualifiedType (com.google.devtools.j2objc.ast.NameQualifiedType)1