public abstract class MWStructToBeanFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Class |
beanType |
protected Map<String,Class> |
beanTypeMap |
protected List<String> |
propNames |
| Constructor and Description |
|---|
MWStructToBeanFactory(Class beanType,
List<String> propNames,
Map<String,Class> beanTypeMap)
Initialize the common properties of the bean factory
|
| Modifier and Type | Method and Description |
|---|---|
Collection<Class> |
getAllPropTypes()
A collection of types of all the fields of the user defined class that can act as target for a MATLAB struct
|
Class |
getBeanType()
Get the underlying user defined class that will be used as target for a MATLAB structure
|
Class |
getJavaClassForStructField(String fieldName)
Returns type of the field referred to by fieldName
|
List<String> |
getPropNames()
Get a list containing all names of the fields of the user defined class.
|
abstract Object |
newInstance(List<String> structFieldNames,
Object... args)
Create instance of user defined class referred to by beanType and assign the values to its fields from the passed
in args array.
|
protected final Class beanType
public MWStructToBeanFactory(Class beanType, List<String> propNames, Map<String,Class> beanTypeMap)
beanType - user defined Java class that will be used as the target for a MATLAB structpropNames - List of strings containing the names of the fields of beanTypebeanTypeMap - A Map containing field names of beanType as keys and their types as valuespublic Class getJavaClassForStructField(String fieldName)
fieldName - Name of the fieldpublic Class getBeanType()
public List<String> getPropNames()
public Collection<Class> getAllPropTypes()
public abstract Object newInstance(List<String> structFieldNames, Object... args)
structFieldNames - names of fields of beanType. The index of a field in this list is used to get the value
from args arrayargs - values of fieldsCopyright © 2015–2021. All rights reserved.