Package org.apache.juneau
Class BeanRegistry
java.lang.Object
org.apache.juneau.BeanRegistry
A lookup table for resolving bean types by name.
In a nutshell, provides a simple mapping of bean class objects to identifying names.
Class names are defined through the @Bean(typeName)
annotation.
The dictionary is used by the framework in the following ways:
- If a class type cannot be inferred through reflection during parsing, then a helper
"_type" is added to the serialized output using the name defined for that class in this dictionary. This helps determine the real class at parse time. - The dictionary name is used as element names when serialized to XML.
See Also:
-
Method Summary
Modifier and TypeMethodDescriptionClassMeta<?>
getClassMeta
(String typeName) Gets the class metadata for the specified bean type name.getTypeName
(ClassMeta<?> c) Given the specified class, return the dictionary name for it.boolean
Returnstrue if this dictionary has an entry for the specified type name.toString()
-
Method Details
-
getClassMeta
Gets the class metadata for the specified bean type name.- Parameters:
typeName
- The bean type name as defined by@Bean(typeName)
. Can include multi-dimensional array type names (e.g."X^^" ).- Returns:
- The class metadata for the bean.
-
getTypeName
Given the specified class, return the dictionary name for it.- Parameters:
c
- The class to lookup in this registry.- Returns:
- The dictionary name for the specified class in this registry, or
null if not found.
-
hasName
Returnstrue if this dictionary has an entry for the specified type name.- Parameters:
typeName
- The bean type name.- Returns:
true if this dictionary has an entry for the specified type name.
-
toString
-