public class Formats extends Object
Modifier and Type | Method and Description |
---|---|
static String |
addSpaceIfNeeded(String string) |
static String |
formatActualTypeArguments(Type type) |
static String |
formatActualTypeArguments(Type[] actualTypeArguments) |
static String |
formatAnnotatedConstructor(javax.enterprise.inject.spi.AnnotatedConstructor<?> constructor) |
static String |
formatAnnotatedField(javax.enterprise.inject.spi.AnnotatedField<?> field) |
static String |
formatAnnotatedMethod(javax.enterprise.inject.spi.AnnotatedMethod<?> method) |
static String |
formatAnnotatedParameter(javax.enterprise.inject.spi.AnnotatedParameter<?> parameter) |
static String |
formatAnnotatedType(javax.enterprise.inject.spi.AnnotatedType<?> type) |
static String |
formatAnnotations(Annotation[] annotations)
Gets a string representation from an array of annotations
|
static String |
formatAnnotations(Iterable<Annotation> annotations) |
static String |
formatAsFormalParameterList(Iterable<? extends javax.enterprise.inject.spi.AnnotatedParameter<?>> parameters) |
static String |
formatAsStackTraceElement(javax.enterprise.inject.spi.InjectionPoint ij)
See also WELD-1454.
|
static String |
formatAsStackTraceElement(Member member) |
static String |
formatBusinessInterfaceDescriptors(Iterable<? extends org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor<?>> businessInterfaceDescriptors) |
static String |
formatInjectionPointType(Type type) |
static String |
formatModifiers(int modifiers) |
static String |
formatParameter(javax.enterprise.inject.spi.AnnotatedParameter<?> parameter) |
static String |
formatSimpleClassName(Class<?> javaClass) |
static String |
formatSimpleClassName(Object object) |
static String |
formatType(Type baseType) |
static String |
formatType(Type baseType,
boolean simpleNames) |
static <D extends GenericDeclaration> |
formatTypeParameters(TypeVariable<D>[] typeParams) |
static String |
formatTypes(Iterable<? extends Type> baseTypes) |
static String |
formatTypes(Iterable<? extends Type> baseTypes,
boolean simpleNames) |
static int |
getLineNumber(Member member)
Try to get the line number associated with the given member.
|
static String |
getNameOfMissingClassLoaderDependency(Throwable e)
Attempts to extract a name of a missing class loader dependency from an exception such as
NoClassDefFoundError or ClassNotFoundException . |
static String |
getSimpleVersion() |
static String |
version(Package pkg) |
static String |
version(String version,
String timestamp) |
static String |
wrapIfNecessary(String string,
String prepend,
String append) |
public static String formatAsStackTraceElement(javax.enterprise.inject.spi.InjectionPoint ij)
ij
- public static int getLineNumber(Member member)
LineNumberTable
attribute is just optional, i.e. the compiler is not required to store this
information at all. See also Java Virtual Machine Specification
Implementation note: it wouldn't be appropriate to add a bytecode scanning dependency just for this functionality, therefore Apache BCEL included in
Oracle JDK 1.5+ and OpenJDK 1.6+ is used. Other JVMs should not crash as we only use it if it's on the classpath and by means of reflection calls.member
- resourceLoader
- public static String formatTypes(Iterable<? extends Type> baseTypes, boolean simpleNames)
public static String formatBusinessInterfaceDescriptors(Iterable<? extends org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor<?>> businessInterfaceDescriptors)
public static String formatAsFormalParameterList(Iterable<? extends javax.enterprise.inject.spi.AnnotatedParameter<?>> parameters)
public static String formatParameter(javax.enterprise.inject.spi.AnnotatedParameter<?> parameter)
public static String formatModifiers(int modifiers)
public static String formatActualTypeArguments(Type[] actualTypeArguments)
public static String formatAnnotations(Iterable<Annotation> annotations)
public static String formatAnnotations(Annotation[] annotations)
annotations
- The annotationspublic static String version(@Deprecated Package pkg)
pkg
- This param is completely ignoredpublic static String getSimpleVersion()
public static String formatAnnotatedType(javax.enterprise.inject.spi.AnnotatedType<?> type)
public static String formatAnnotatedConstructor(javax.enterprise.inject.spi.AnnotatedConstructor<?> constructor)
public static String formatAnnotatedField(javax.enterprise.inject.spi.AnnotatedField<?> field)
public static String formatAnnotatedMethod(javax.enterprise.inject.spi.AnnotatedMethod<?> method)
public static String formatAnnotatedParameter(javax.enterprise.inject.spi.AnnotatedParameter<?> parameter)
public static String getNameOfMissingClassLoaderDependency(Throwable e)
NoClassDefFoundError
or ClassNotFoundException
.public static <D extends GenericDeclaration> String formatTypeParameters(TypeVariable<D>[] typeParams)
Copyright © 2019. All rights reserved.