Java Code Examples for javax.lang.model.element.AnnotationValueVisitor#visitType()
The following examples show how to use
javax.lang.model.element.AnnotationValueVisitor#visitType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TreeBackedAnnotationValue.java From buck with Apache License 2.0 | 6 votes |
@Override public <R, P> R accept(AnnotationValueVisitor<R, P> v, @Nullable P p) { Object underlyingValue = underlyingAnnotationValue.getValue(); Object value = getValue(); if (underlyingValue.equals(value)) { return underlyingAnnotationValue.accept(v, p); } if (value instanceof TreeBackedVariableElement) { return v.visitEnumConstant((TreeBackedVariableElement) value, p); } else if (value instanceof TypeMirror) { return v.visitType((TypeMirror) value, p); } else if (value instanceof TreeBackedAnnotationMirror) { return v.visitAnnotation((TreeBackedAnnotationMirror) value, p); } else if (value instanceof List) { @SuppressWarnings("unchecked") List<? extends AnnotationValue> valuesList = (List<? extends AnnotationValue>) value; return v.visitArray(valuesList, p); } else { throw new IllegalStateException(String.format("Unexpected annotation value: %s", value)); } }
Example 2
Source File: TurbineAnnotationMirror.java From turbine with Apache License 2.0 | 5 votes |
@Override public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { if (value.type().tyKind() == TyKind.ERROR_TY) { // represent unresolvable class literals as the string value "<error>" for compatibility // with javac: https://bugs.openjdk.java.net/browse/JDK-8229535 return v.visitString("<error>", p); } else { return v.visitType(getValue(), p); } }
Example 3
Source File: AnnotationValueImpl.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@SuppressWarnings("unchecked") // Need to cast Object _value to a List<AnnotationValue> @Override public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { switch (_kind) { case TypeIds.T_boolean: return v.visitBoolean((Boolean)_value, p); case TypeIds.T_byte: return v.visitByte((Byte)_value, p); case TypeIds.T_char: return v.visitChar((Character)_value, p); case TypeIds.T_double: return v.visitDouble((Double)_value, p); case TypeIds.T_float: return v.visitFloat((Float)_value, p); case TypeIds.T_int: return v.visitInt((Integer)_value, p); case TypeIds.T_JavaLangString: return v.visitString((String)_value, p); case TypeIds.T_long: return v.visitLong((Long)_value, p); case TypeIds.T_short: return v.visitShort((Short)_value, p); case T_EnumConstant: return v.visitEnumConstant((VariableElement)_value, p); case T_ClassObject: return v.visitType((TypeMirror)_value, p); case T_AnnotationMirror: return v.visitAnnotation((AnnotationMirror)_value, p); case T_ArrayType: return v.visitArray((List<AnnotationValue>)_value, p); default: return null; } }
Example 4
Source File: Attribute.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 5
Source File: Attribute.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 6
Source File: Attribute.java From java-n-IDE-for-Android with Apache License 2.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(type, p); }
Example 7
Source File: Attribute.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 8
Source File: Attribute.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 4 votes |
@DefinedBy(Api.LANGUAGE_MODEL) public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 9
Source File: Attribute.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 10
Source File: Attribute.java From javaide with GNU General Public License v3.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(type, p); }
Example 11
Source File: Attribute.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@DefinedBy(Api.LANGUAGE_MODEL) public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 12
Source File: Attribute.java From hottub with GNU General Public License v2.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 13
Source File: Attribute.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 14
Source File: Attribute.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) { return v.visitType(classType, p); }
Example 15
Source File: SimpleTypeAnnotationValue.java From auto with Apache License 2.0 | 4 votes |
@Override public <R, P> R accept(AnnotationValueVisitor<R, P> visitor, P parameter) { return visitor.visitType(getValue(), parameter); }