Class FactModelTree
- java.lang.Object
-
- org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree
-
@Portable public class FactModelTree extends Object
Class used to recursively represent a given fact with its ModelFields eventually expanded
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFactModelTree.PropertyTypeNameNested DTO which holds a Property name.static classFactModelTree.Type
-
Constructor Summary
Constructors Constructor Description FactModelTree()FactModelTree(String factName, String fullPackage, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap)Call this constructor to have aFactModelTreewith UNDEFINEDType.FactModelTree(String factName, String fullPackage, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap, String typeName)Call this constructor to have aFactModelTreewith UNDEFINEDTypeand the type (eg.FactModelTree(String factName, String fullPackage, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap, FactModelTree.Type type)Call this constructor to specify theFactModelTree'Type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExpandableProperty(String propertyName, String propertyType)voidaddSimpleProperty(String propertyName, FactModelTree.PropertyTypeName propertyTypeName)FactModelTreecloneFactModelTree()Map<String,String>getExpandableProperties()StringgetFactName()StringgetFullPackage()StringgetFullTypeName()List<String>getGenericTypeInfo(String propertyName)Returns the generic type info of the given propertyMap<String,List<String>>getGenericTypesMap()StringgetImportPrefix()Map<String,FactModelTree.PropertyTypeName>getSimpleProperties()FactModelTree.TypegetType()StringgetTypeName()booleanisSimple()static FactModelTreeofDMN(String factName, String importPrefix, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap, String typeName, FactModelTree.Type type)Static factory method to be used in DMN context.static FactModelTreeofDMO(String factName, String fullPackage, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap, String typeName)Static factory method to be used in DMO (Rule) context.static FactModelTreeofSimpleDMN(String factName, String importPrefix, String simplePropertyType, Map<String,List<String>> genericTypeInfoMap, String typeName, FactModelTree.Type type)Static factory method to be used in DMN context, to create a Simple Type FactModelTree.static FactModelTreeofSimpleDMO(String factName, String fullPackage, String simplePropertyFullClass, String typeName)Static factory method to be used in DMO (Rule) context, to create a Simple Type FactModelTree.voidremoveSimpleProperty(String propertyName)voidsetSimple(boolean simple)StringtoString()
-
-
-
Constructor Detail
-
FactModelTree
public FactModelTree()
-
FactModelTree
public FactModelTree(String factName, String fullPackage, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap)
Call this constructor to have aFactModelTreewith UNDEFINEDType. RULE Test Scenario specific.- Parameters:
factName-fullPackage-simpleProperties-genericTypesMap- the generic type info, in the format {collection_class_name}#{generic_type}: ex "java.util.List#com.Book"
-
FactModelTree
public FactModelTree(String factName, String fullPackage, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap, String typeName)
Call this constructor to have aFactModelTreewith UNDEFINEDTypeand the type (eg. ClassName) differs from the factName (A case is for nested classes eg Class.Nested as FactName and Class$Nested as className. RULE Test Scenario specific.- Parameters:
factName-fullPackage-simpleProperties-genericTypesMap- the generic type info, in the format {collection_class_name}#{generic_type}: ex "java.util.List#com.Book"typeName- The typeName of the fact (the className)
-
FactModelTree
public FactModelTree(String factName, String fullPackage, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap, FactModelTree.Type type)
Call this constructor to specify theFactModelTree'Type. DMN Test Scenario specific.- Parameters:
factName-fullPackage-simpleProperties-genericTypesMap- the generic type info, in the format {collection_class_name}#{generic_type}: ex "java.util.List#com.Book"type-
-
-
Method Detail
-
ofDMO
public static FactModelTree ofDMO(String factName, String fullPackage, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap, String typeName)
Static factory method to be used in DMO (Rule) context.- Parameters:
factName-fullPackage-simpleProperties-genericTypesMap-typeName-- Returns:
-
ofSimpleDMO
public static FactModelTree ofSimpleDMO(String factName, String fullPackage, String simplePropertyFullClass, String typeName)
Static factory method to be used in DMO (Rule) context, to create a Simple Type FactModelTree.- Parameters:
factName-fullPackage-simplePropertyFullClass-typeName-- Returns:
-
ofDMN
public static FactModelTree ofDMN(String factName, String importPrefix, Map<String,FactModelTree.PropertyTypeName> simpleProperties, Map<String,List<String>> genericTypesMap, String typeName, FactModelTree.Type type)
Static factory method to be used in DMN context.- Parameters:
factName-simpleProperties-genericTypesMap-typeName-type-- Returns:
-
ofSimpleDMN
public static FactModelTree ofSimpleDMN(String factName, String importPrefix, String simplePropertyType, Map<String,List<String>> genericTypeInfoMap, String typeName, FactModelTree.Type type)
Static factory method to be used in DMN context, to create a Simple Type FactModelTree.- Parameters:
factName-simplePropertyType-genericTypeInfoMap-typeName-type-- Returns:
-
getFactName
public String getFactName()
-
getFullPackage
public String getFullPackage()
-
getSimpleProperties
public Map<String,FactModelTree.PropertyTypeName> getSimpleProperties()
-
addSimpleProperty
public void addSimpleProperty(String propertyName, FactModelTree.PropertyTypeName propertyTypeName)
-
getGenericTypeInfo
public List<String> getGenericTypeInfo(String propertyName)
Returns the generic type info of the given property- Parameters:
propertyName-- Returns:
- the
Listof generic types, or an empty one
-
removeSimpleProperty
public void removeSimpleProperty(String propertyName)
-
isSimple
public boolean isSimple()
-
setSimple
public void setSimple(boolean simple)
-
getType
public FactModelTree.Type getType()
-
getTypeName
public String getTypeName()
-
getFullTypeName
public String getFullTypeName()
-
getImportPrefix
public String getImportPrefix()
-
cloneFactModelTree
public FactModelTree cloneFactModelTree()
-
-