@Override public String toString() { return "SystemInjecteeImpl(requiredType=" + Pretty.type(requiredType) + ",parent=" + Pretty.clazz(pClass) + ",qualifiers=" + Pretty.collection(qualifiers) + ",position=" + position + ",optional=" + isOptional + ",self=" + isSelf + ",unqualified=" + unqualified + "," + System.identityHashCode(this) + ")"; }
/** * Returns a pretty string representing the collection * @param collection A possibly null collection to represent * @return A pretty string representing the collection */ public static String collection(Collection<?> collection) { if (collection == null) return NULL_STRING; return array(collection.toArray(new Object[collection.size()])); }
@Override public String toString() { return "MethodWrapperImpl(" + Pretty.method(method) + "," + System.identityHashCode(this) + ")"; }
public String toString() { return "IterableProviderImpl(" + Pretty.type(requiredType) + "," + Pretty.collection(requiredQualifiers) + "," + System.identityHashCode(this) + ")"; }
/** * Returns a pretty string for the given type * @param t A possibly null type * @return A pretty string representing the type */ public static String type(Type t) { if (t == null) return NULL_STRING; if (t instanceof Class) { return clazz((Class<?>) t); } if (t instanceof ParameterizedType) { return pType((ParameterizedType) t); } return t.toString(); }
/** * Returns a pretty string representing a Field * @param field The possibly null field * @return A pretty string representing the field */ public static String field(Field field) { if (field == null) return NULL_STRING; Type t = field.getGenericType(); String baseString; if (t instanceof Class) { baseString = clazz((Class<?>) t); } else { baseString = type(t); } return "field(" + baseString + " " + field.getName() + " in " + field.getDeclaringClass().getName() + ")"; }
private static String prettyPrintParameters(Class<?> params[]) { if (params == null) return NULL_STRING; StringBuffer sb = new StringBuffer("("); boolean first = true; for (Class<?> param : params) { if (first) { sb.append(clazz(param)); first = false; } else { sb.append("," + clazz(param)); } } sb.append(")"); return sb.toString(); }
public String toString() { return "DynamicConfigurationImpl(" + locator + "," + Pretty.collection(allDescriptors) + "," + Pretty.collection(allUnbindFilters) + "," + Pretty.collection(allResources) + "," + System.identityHashCode(this) + ")"; } }
public String toString() { return "CacheKey(" + Pretty.type(lookupType) + "," + name + "," + ((qualifiers == null) ? 0 : qualifiers.length) + "," + System.identityHashCode(this) + "," + hashCode + ")"; }
/** * Make a nice pretty string out of the constructor and all its * parameters * * @param constructor The constructor to make pretty * @return A nice pretty string */ public static String constructor(Constructor<?> constructor) { if (constructor == null) return NULL_STRING; return CONSTRUCTOR_NAME + prettyPrintParameters(constructor.getParameterTypes()); }
public String toString() { return Pretty.pType(this); }
/** * Will find all the initialize fields in the class * * @param annotatedType The class to search for fields * @param locator The locator to use when analyzing the class * @param errorCollector The error collector * @return A non-null but possibly empty set of initializer fields */ public static Set<Field> findInitializerFields(Class<?> annotatedType, ServiceLocatorImpl locator, Collector errorCollector) { LinkedHashSet<Field> retVal = new LinkedHashSet<Field>(); ClassReflectionHelper crh = locator.getClassReflectionHelper(); Set<Field> fields = crh.getAllFields(annotatedType); for (Field field : fields) { if (!locator.hasInjectAnnotation(field)) { // Not an initializer field continue; } if (!isProperField(field)) { errorCollector.addThrowable(new IllegalArgumentException("The field " + Pretty.field(field) + " may not be static, final or have an Annotation type")); continue; } retVal.add(field); } return retVal; }
/** * Returns a pretty string representing a Field * @param field The possibly null field * @return A pretty string representing the field */ public static String field(Field field) { if (field == null) return NULL_STRING; Type t = field.getGenericType(); String baseString; if (t instanceof Class) { baseString = clazz((Class<?>) t); } else { baseString = type(t); } return "field(" + baseString + " " + field.getName() + " in " + field.getDeclaringClass().getName() + ")"; }
private static String prettyPrintParameters(Class<?> params[]) { if (params == null) return NULL_STRING; StringBuffer sb = new StringBuffer("("); boolean first = true; for (Class<?> param : params) { if (first) { sb.append(clazz(param)); first = false; } else { sb.append("," + clazz(param)); } } sb.append(")"); return sb.toString(); }
public String toString() { return "IterableProviderImpl(" + Pretty.type(requiredType) + "," + Pretty.collection(requiredQualifiers) + "," + System.identityHashCode(this) + ")"; }
/** * Returns a pretty string for the given type * @param t A possibly null type * @return A pretty string representing the type */ public static String type(Type t) { if (t == null) return NULL_STRING; if (t instanceof Class) { return clazz((Class<?>) t); } if (t instanceof ParameterizedType) { return pType((ParameterizedType) t); } return t.toString(); }
public String toString() { return "DynamicConfigurationImpl(" + locator + "," + Pretty.collection(allDescriptors) + "," + Pretty.collection(allUnbindFilters) + "," + System.identityHashCode(this) + ")"; }
public String toString() { return "CacheKey(" + Pretty.type(lookupType) + "," + name + "," + ((qualifiers == null) ? 0 : qualifiers.length) + "," + System.identityHashCode(this) + "," + hashCode + ")"; }
/** * Make a nice pretty string out of the constructor and all its * parameters * * @param constructor The constructor to make pretty * @return A nice pretty string */ public static String constructor(Constructor<?> constructor) { if (constructor == null) return NULL_STRING; return CONSTRUCTOR_NAME + prettyPrintParameters(constructor.getParameterTypes()); }
public String toString() { return Pretty.pType(this); }