|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.hk2.internal.ReflectionHelper
public class ReflectionHelper
| Constructor Summary | |
|---|---|
ReflectionHelper()
|
|
| Method Summary | |
|---|---|
static void |
addMetadata(Map<String,List<String>> metadatas,
String key,
String value)
Adds a value to the list of values associated with this key |
static void |
checkCharacters(String... checkMes)
Checks that no values come in that might mess up the parsing of the descriptor |
static Map<String,List<String>> |
deepCopyMetadata(Map<String,List<String>> copyMe)
This method does a deep copy of the incoming meta-data, (which basically means we will also make copies of the value list) |
static Set<Type> |
getAdvertisedTypesFromObject(Object t)
Returns the set of types this class advertises |
static Set<String> |
getContractsFromClass(Class<?> clazz)
Returns the set of types this class advertises |
static String |
getName(Class<?> implClass)
Returns the name that should be associated with this class |
static Set<String> |
getQualifiersFromClass(Class<?> clazz)
Gets all the qualifiers from the object |
static Set<Annotation> |
getQualifiersFromObject(Object t)
Gets all the qualifiers from the object |
static Class<?> |
getRawClass(Type type)
Given the type parameter gets the raw type represented by the type, or null if this has no associated raw class |
static Class<? extends Annotation> |
getScopeFromClass(Class<?> clazz)
Gets the scope annotation from the object |
static Class<? extends Annotation> |
getScopeFromObject(Object t)
Gets the scope annotation from the object |
static String |
prettyPrintDescriptor(Descriptor d)
Pretty prints this descriptor |
static void |
readMetadataMap(String line,
Map<String,List<String>> addToMe)
Writes a set in a way that can be read from an input stream as well |
static void |
readSet(String line,
Collection<String> addToMe)
Writes a set in a way that can be read from an input stream as well. |
static boolean |
removeAllMetadata(Map<String,List<String>> metadatas,
String key)
Removes all the metadata values associated with key |
static boolean |
removeMetadata(Map<String,List<String>> metadatas,
String key,
String value)
Removes the given value from the given key |
static String |
writeMetadata(Map<String,List<String>> metadata)
Used to write the metadata out |
static String |
writeSet(Set<?> set)
Writes a set in a way that can be read from an input stream as well |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReflectionHelper()
| Method Detail |
|---|
public static Class<?> getRawClass(Type type)
type - The type to find the raw class on
public static String getName(Class<?> implClass)
implClass - The class to evaluate
public static Set<Type> getAdvertisedTypesFromObject(Object t)
t - the object we are analyzing
public static Set<String> getContractsFromClass(Class<?> clazz)
clazz - the class we are analyzing
public static Class<? extends Annotation> getScopeFromObject(Object t)
t - The object to analyze
public static Class<? extends Annotation> getScopeFromClass(Class<?> clazz)
clazz - The class to analyze
public static Set<Annotation> getQualifiersFromObject(Object t)
t - The object to analyze
public static Set<String> getQualifiersFromClass(Class<?> clazz)
clazz - The class to analyze
public static String writeSet(Set<?> set)
set - The set to write
public static void readSet(String line,
Collection<String> addToMe)
throws IOException
line - The line to readaddToMe - The set to add the strings to
IOException - On a failure
public static void readMetadataMap(String line,
Map<String,List<String>> addToMe)
throws IOException
line - The line to readaddToMe - The set to add the strings to
IOException - On a failurepublic static String writeMetadata(Map<String,List<String>> metadata)
metadata - The metadata to externalize
public static String prettyPrintDescriptor(Descriptor d)
d - The descriptor to write out nicely
public static void addMetadata(Map<String,List<String>> metadatas,
String key,
String value)
metadatas - The base metadata objectkey - The key to which to add the value. May not be nullvalue - The value to add. May not be null
public static boolean removeMetadata(Map<String,List<String>> metadatas,
String key,
String value)
metadatas - The base metadata objectkey - The key of the value to remove. May not be nullvalue - The value to remove. May not be null
public static boolean removeAllMetadata(Map<String,List<String>> metadatas,
String key)
metadatas - The base metadata objectkey - The key of the metadata values to remove
public static Map<String,List<String>> deepCopyMetadata(Map<String,List<String>> copyMe)
copyMe - The guy to copy (if null, null will be returned)
public static void checkCharacters(String... checkMes)
checkMes - The values to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||