Class BeanInfo<T>
- Type Parameters:
T- The raw class type this instance represents.
- All Implemented Interfaces:
Comparable<ClassInfo>,Type,Annotatable
- Direct Known Subclasses:
ClassMeta
BeanMeta-equivalents, BeanPropertyMeta-equivalents, etc.) need without coupling
the bean-modeling layer to the marshalling-side ClassMeta.
Marshalling-side ClassMeta<T> extends this class; bean-modeling-side code only sees
BeanInfo. The bean-modeling-side never instantiates this class directly — it always
gets instances handed in by the marshalling layer (e.g. via builder calls like
BeanPropertyMeta.Builder#rawMetaType(ClassMeta)).
All extra abstract methods declared here mirror methods that ClassMeta already implements,
so ClassMeta satisfies this contract by virtue of its existing implementation.
Thread safety
Thread safety depends on implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanReturnstrue if this class can be instantiated using a no-arg constructor.abstract booleancanCreateNewInstance(Object outer) Returnstrue if this class can be instantiated, optionally with the specified outer object for non-static inner classes.abstract BeanConfigContextReturns theBeanConfigContextassociated with this type-info.abstract BeanInfo<?>For array andCollectiontypes, returns the type info of the element type, ornull if this is not an array/collection.abstract BeanInfo<?>ForMaptypes, returns the type info of the key type, ornull if this is not a map.abstract ObjectReturns the marshalling-side context associated with this type-info, as an opaqueObject.abstract ObjectForOptionaltypes, returns an empty optional default value, ornull if this isn't an Optional.abstract BeanInfo<?>ForMaptypes, returns the type info of the value type, ornull if this is not a map.abstract booleanisBean()Returnstrue if this class is classified as a bean.abstract booleanisUri()Returnstrue if this class is a URI/URL or annotated with a URI marker.abstract TCreates a new instance of this class.Methods inherited from class org.apache.juneau.commons.reflect.ClassInfoTyped
getPrimitiveDefault, innerMethods inherited from class org.apache.juneau.commons.reflect.ClassInfo
appendNameFormatted, arrayType, asSubclass, canAcceptArg, cast, compareTo, componentType, descriptorString, equals, findGetter, findSetter, getAllFields, getAllMethods, getAllMethodsTopDown, getAllParents, getAnnotatableType, getAnnotatedInterfaces, getAnnotatedSuperclass, getAnnotations, getAnnotations, getClassLoader, getComponentType, getDeclaredAnnotations, getDeclaredConstructor, getDeclaredConstructors, getDeclaredField, getDeclaredFields, getDeclaredFieldsInDeclarationOrder, getDeclaredInterfaces, getDeclaredMemberClasses, getDeclaredMethod, getDeclaredMethods, getDeclaringClass, getDimensions, getEnclosingClass, getEnclosingConstructor, getEnclosingMethod, getGenericInterfaces, getGenericSuperclass, getInterfaces, getLabel, getMemberClasses, getMethod, getModule, getName, getNameCanonical, getNameFormatted, getNameFull, getNameReadable, getNames, getNameShort, getNameSimple, getNestHost, getNestMembers, getNoArgConstructor, getPackage, getPackageAnnotation, getParameterType, getParents, getParentsAndInterfaces, getPermittedSubclasses, getPrimitiveForWrapper, getPrimitiveWrapper, getProtectionDomain, getPublicConstructor, getPublicConstructors, getPublicField, getPublicFields, getPublicMethod, getPublicMethods, getRecordComponents, getRepeatedAnnotationMethod, getResource, getResourceAsStream, getSigners, getSuperclass, getTypeParameters, getWrapperIfPrimitive, hasAnnotation, hashCode, hasPackage, hasPrimitiveWrapper, inject, inject, innerType, is, is, is, isAnnotation, isAnonymousClass, isAny, isAny, isAny, isAny, isAny, isArray, isAssignableFrom, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isAssignableTo, isAssignableToAny, isBoolean, isCharSequence, isChildOf, isChildOf, isChildOf, isClass, isCollection, isCollectionOrArray, isDateOrCalendar, isDecimal, isDeprecated, isDouble, isEnum, isInjectCollectionType, isInstance, isLocalClass, isLong, isMap, isMemberClass, isNestmateOf, isNonStaticMemberClass, isNotDeprecated, isNotLocalClass, isNotMemberClass, isNotNonStaticMemberClass, isNotPrimitive, isNotVoid, isNumber, isObject, isOptional, isParentOf, isParentOf, isParentOf, isParentOfLenient, isParentOfLenient, isParentOfLenient, isPrimitive, isRecord, isRepeatedAnnotation, isRuntimeException, isSealed, isStrictChildOf, isSynthetic, isTemporal, isVisible, isVoid, of, of, of, of, ofProxy, toString, unwrapMethods inherited from class org.apache.juneau.commons.reflect.ElementInfo
ai, getModifiers, isAbstract, isAll, isAny, isFinal, isInterface, isNative, isNotAbstract, isNotFinal, isNotInterface, isNotNative, isNotPrivate, isNotProtected, isNotPublic, isNotStatic, isNotSynchronized, isNotTransient, isNotVolatile, isPrivate, isProtected, isPublic, isStatic, isSynchronized, isTransient, isVolatileMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.reflect.Type
getTypeName
-
Constructor Details
-
BeanInfo
Constructor.- Parameters:
inner- The class type.
-
BeanInfo
Constructor.- Parameters:
inner- The class type.innerType- The generic type (if parameterized type).
-
-
Method Details
-
isUri
Returnstrue if this class is a URI/URL or annotated with a URI marker.- Returns:
true if this class is a URI.
-
isBean
Returnstrue if this class is classified as a bean.- Returns:
true if this class is a bean.
-
getElementType
For array andCollectiontypes, returns the type info of the element type, ornull if this is not an array/collection.- Returns:
- The element type info, or
null .
-
getKeyType
ForMaptypes, returns the type info of the key type, ornull if this is not a map.- Returns:
- The key type info, or
null .
-
getValueType
ForMaptypes, returns the type info of the value type, ornull if this is not a map.- Returns:
- The value type info, or
null .
-
canCreateNewInstance
Returnstrue if this class can be instantiated using a no-arg constructor.- Returns:
true if a new instance can be created.
-
canCreateNewInstance
Returnstrue if this class can be instantiated, optionally with the specified outer object for non-static inner classes.- Parameters:
outer- The outer object instance, ornull if not applicable.- Returns:
true if a new instance can be created.
-
newInstance
Creates a new instance of this class.- Overrides:
newInstancein classClassInfo- Returns:
- A new instance of the class.
- Throws:
ExecutableException- If the class could not be instantiated.
-
getOptionalDefault
ForOptionaltypes, returns an empty optional default value, ornull if this isn't an Optional.Returns
Objectrather thanTbecause the marshalling-sideClassMetareturns a wildcardOptional<?>which is not assignable toTunder Java's type system.- Returns:
- The default empty Optional value, or
null .
-
getBeanConfigContext
Returns theBeanConfigContextassociated with this type-info.On the marshalling-side this returns the bean-modeling subset of the
MarshallingContextthat carried this type-info; on commons-sideBeanInfoconstruction paths (none exist in-tree currently;BeanInfois currently always realized by marshalling-sideClassMeta), this should return theBeanConfigContextthe type-info was built against.- Returns:
- The bean-modeling configuration carried alongside this type-info. Never
null .
-
getMarshallingContext
Returns the marshalling-side context associated with this type-info, as an opaqueObject.On the marshalling-side this is the
MarshallingContextthat carried this type-info; the return type is widened toObjectso callers incommons.beando not need to importMarshallingContext. Callers cast to the marshalling-side type at the use site.- Returns:
- The marshalling context, or
null if none is associated with this type-info.
-