- java.lang.Object
-
- io.github.mmm.bean.impl.BeanTypeImpl
-
- io.github.mmm.bean.impl.BeanClassImpl
-
public final class BeanClassImpl extends BeanTypeImpl implements BeanClass
-
-
Constructor Summary
Constructors Constructor Description BeanClassImpl(Class<? extends VirtualBean> javaClass, List<BeanClassImpl> superClassList)
The constructor.BeanClassImpl(Class<? extends VirtualBean> javaClass, List<BeanClassImpl> superClassList, String stableName)
The constructor.BeanClassImpl(Class<? extends VirtualBean> javaClass, List<BeanClassImpl> superClassList, String stableName, String simpleName)
The constructor.BeanClassImpl(Class<? extends VirtualBean> javaClass, List<BeanClassImpl> superClassList, String packageName, String stableName, String simpleName)
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BeanClassImpl
asClass(Class<? extends VirtualBean> javaClass)
static BeanClassImpl
asClass(Class<? extends VirtualBean> javaClass, Function<Class<?>,BeanClassImpl> factory)
static BeanClassImpl
getClass(String key)
Class<? extends VirtualBean>
getJavaClass()
Class<?>[]
getJavaClasses()
String
getPackageName()
VirtualBean
getPrototype()
String
getQualifiedName()
String
getSimpleName()
List<BeanClass>
getSuperClasses()
boolean
isVirtual()
void
setPrototype(VirtualBean prototype)
-
Methods inherited from class io.github.mmm.bean.impl.BeanTypeImpl
asType, asType, equals, getStableName, getStableName, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.bean.BeanClass
isSubclassOf, isSubclassOf, isSuperclassOf, isSuperclassOf
-
Methods inherited from interface io.github.mmm.bean.BeanType
getStableName
-
-
-
-
Constructor Detail
-
BeanClassImpl
public BeanClassImpl(Class<? extends VirtualBean> javaClass, List<BeanClassImpl> superClassList)
The constructor.- Parameters:
javaClass
- theClass
of theBean
to reflect.superClassList
- thesuper-classes
.
-
BeanClassImpl
public BeanClassImpl(Class<? extends VirtualBean> javaClass, List<BeanClassImpl> superClassList, String stableName)
The constructor.- Parameters:
javaClass
- theClass
of theBean
to reflect.superClassList
- thesuper-classes
.stableName
- thestable name
.
-
BeanClassImpl
public BeanClassImpl(Class<? extends VirtualBean> javaClass, List<BeanClassImpl> superClassList, String stableName, String simpleName)
The constructor.- Parameters:
javaClass
- theClass
of theBean
to reflect.superClassList
- thesuper-classes
.stableName
- thestable name
.simpleName
- thesimple name
.
-
BeanClassImpl
public BeanClassImpl(Class<? extends VirtualBean> javaClass, List<BeanClassImpl> superClassList, String packageName, String stableName, String simpleName)
The constructor.- Parameters:
javaClass
- theClass
of theBean
to reflect.superClassList
- thesuper-classes
.packageName
- thepackage name
.stableName
- thestable name
.simpleName
- thesimple name
.
-
-
Method Detail
-
getJavaClass
public Class<? extends VirtualBean> getJavaClass()
- Specified by:
getJavaClass
in interfaceBeanClass
- Specified by:
getJavaClass
in interfaceBeanType
- Overrides:
getJavaClass
in classBeanTypeImpl
- Returns:
- the primary
Class
(or interface) reflecting the "implementation" of thisBeanType
. If thisBeanType
isvirtual
this will be inherited from the first parent class.
-
getJavaClasses
public Class<?>[] getJavaClasses()
- Specified by:
getJavaClasses
in interfaceBeanType
- Returns:
- an array with all types (interfaces) composed (implemented) by this
BeanType
.
-
getSuperClasses
public List<BeanClass> getSuperClasses()
- Specified by:
getSuperClasses
in interfaceBeanClass
- Returns:
- the
Collection
of the superBeanClass
this class inherits from.
-
getPackageName
public String getPackageName()
- Specified by:
getPackageName
in interfaceBeanType
- Overrides:
getPackageName
in classBeanTypeImpl
- Returns:
- packageName the
package name
. - See Also:
BeanType.getJavaClass()
,Class.getPackageName()
,BeanType.getQualifiedName()
-
getSimpleName
public String getSimpleName()
- Specified by:
getSimpleName
in interfaceBeanType
- Overrides:
getSimpleName
in classBeanTypeImpl
- Returns:
- the
simple name
. - See Also:
BeanType.getJavaClass()
,Class.getSimpleName()
,BeanType.getQualifiedName()
-
getQualifiedName
public String getQualifiedName()
- Specified by:
getQualifiedName
in interfaceBeanType
- Overrides:
getQualifiedName
in classBeanTypeImpl
- Returns:
- qualifiedName the
qualified name
composed ofpackage name
andsimple name
. - See Also:
BeanType.getPackageName()
,BeanType.getSimpleName()
,BeanType.getJavaClass()
,Class.getName()
-
isVirtual
public boolean isVirtual()
- Specified by:
isVirtual
in interfaceBeanType
- Overrides:
isVirtual
in classBeanTypeImpl
- Returns:
true
if thisBeanType
belongs to aVirtualBean
meaning that it may represent a class or interface that does not exist as JavaClass
,false
otherwise.- See Also:
BeanClass
,VirtualBean
-
getPrototype
public VirtualBean getPrototype()
- Specified by:
getPrototype
in interfaceBeanClass
- Returns:
- the prototype of this
BeanClass
. Properties added to this prototype will be inherited by all instances of thisBeanClass
including those created before adding the new property.
-
setPrototype
public void setPrototype(VirtualBean prototype)
- Parameters:
prototype
- theprototype
.
-
asClass
public static BeanClassImpl asClass(Class<? extends VirtualBean> javaClass)
- Parameters:
javaClass
- theClass
reflecting theAdvancedBean
.- Returns:
- the
BeanClass
for this instance.
-
getClass
public static BeanClassImpl getClass(String key)
- Parameters:
key
- the fully-qualified (virtual or physical) class-name.- Returns:
- the
BeanClass
for this instance.
-
asClass
public static BeanClassImpl asClass(Class<? extends VirtualBean> javaClass, Function<Class<?>,BeanClassImpl> factory)
- Parameters:
javaClass
- theClass
reflecting theAdvancedBean
.factory
- aFunction
to get or createBeanClassImpl
byClass
.- Returns:
- the
BeanClass
for this instance.
-
-