@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { AnnotationValue value = annotationInstance.value(); return value.asClass().toString(); } }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { AnnotationValue value = annotationInstance.value(); return value.asClass().toString(); } }
List<String> parameterTypes = new ArrayList<String>(m.args().length); for (Type type : m.args()) { parameterTypes.add(type.toString());
/** * Returns a string representation for this type. It is similar, yet not equivalent * to a Java source code representation. * * @return the string representation. */ public String toString() { return toString(false); }
String toString(boolean simple) { StringBuilder builder = new StringBuilder(); appendAnnotations(builder); builder.append(name); // FIXME - revist this logic if (!simple && bounds.length > 0 && !(bounds.length == 1 && ClassType.OBJECT_TYPE.equals(bounds[0]))) { builder.append(" extends ").append(bounds[0].toString(true)); for (int i = 1; i < bounds.length; i++) { builder.append(" & ").append(bounds[i].toString(true)); } } return builder.toString(); }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance) { AnnotationValue value = annotationInstance.value(); return value.asClass().toString(); } }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance) { AnnotationValue value = annotationInstance.value(); return value.asClass().toString(); } }
private boolean hasInjectionPoint(DeploymentUnit depUnit, String anName) { boolean result = false; CompositeIndex compositeIndex = depUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX); List<AnnotationInstance> annotationList = compositeIndex.getAnnotations(DotName.createSimple(anName)); for (AnnotationInstance instance : annotationList) { AnnotationTarget target = instance.target(); if (target instanceof FieldInfo) { FieldInfo fieldInfo = (FieldInfo) target; String typeName = fieldInfo.type().toString(); if (typeName.startsWith("org.osgi.framework") || typeName.startsWith("org.osgi.service")) { LOGGER.debugf("OSGi injection point of type '%s' detected: %s", typeName, fieldInfo.declaringClass()); result = true; break; } } } return result; } }
private boolean hasInjectionPoint(DeploymentUnit depUnit, String anName) { boolean result = false; CompositeIndex compositeIndex = depUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX); List<AnnotationInstance> annotationList = compositeIndex.getAnnotations(DotName.createSimple(anName)); for (AnnotationInstance instance : annotationList) { AnnotationTarget target = instance.target(); if (target instanceof FieldInfo) { FieldInfo fieldInfo = (FieldInfo) target; String typeName = fieldInfo.type().toString(); if (typeName.startsWith("org.osgi.framework") || typeName.startsWith("org.osgi.service")) { LOGGER.debugf("OSGi injection point of type '%s' detected: %s", typeName, fieldInfo.declaringClass()); result = true; break; } } } return result; } }
List<String> parameterTypes = new ArrayList<String>(m.args().length); for (Type type : m.args()) { parameterTypes.add(type.toString());
List<String> parameterTypes = new ArrayList<String>(m.args().length); for (Type type : m.args()) { parameterTypes.add(type.toString());
for (Type type : m.args()) parameterTypes.add(type.toString());
public static IJavaType wrap(Type type) { switch (type.kind()) { case ARRAY: return new ArrayTypeWrapper(type.asArrayType()); case CLASS: return new ClassTypeWrapper(type.asClassType()); case PARAMETERIZED_TYPE: return new ParameterizedTypeWrapper(type.asParameterizedType()); case PRIMITIVE: return wrap(type.asPrimitiveType()); case TYPE_VARIABLE: return new TypeVariableWrapper(type.asTypeVariable()); case UNRESOLVED_TYPE_VARIABLE: return new UnresolvedTypeVariableWrapper(type.asUnresolvedTypeVariable()); case VOID: return IVoidType.DEFAULT; case WILDCARD_TYPE: return new WildcardTypeWrapper(type.asWildcardType()); } throw new IllegalArgumentException("Invalid Java Type " + type.toString()); }