Class FactModelTree


  • @Portable
    public class FactModelTree
    extends Object
    Class used to recursively represent a given fact with its ModelFields eventually expanded
    • 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 a FactModelTree with UNDEFINED Type. 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 a FactModelTree with UNDEFINED Type and 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 the FactModelTree' 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

      • 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:
      • 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()
      • getExpandableProperties

        public Map<String,​String> getExpandableProperties()
      • addExpandableProperty

        public void addExpandableProperty​(String propertyName,
                                          String propertyType)
      • getGenericTypeInfo

        public List<String> getGenericTypeInfo​(String propertyName)
        Returns the generic type info of the given property
        Parameters:
        propertyName -
        Returns:
        the List of generic types, or an empty one
      • removeSimpleProperty

        public void removeSimpleProperty​(String propertyName)
      • isSimple

        public boolean isSimple()
      • setSimple

        public void setSimple​(boolean simple)
      • getTypeName

        public String getTypeName()
      • getFullTypeName

        public String getFullTypeName()
      • getImportPrefix

        public String getImportPrefix()