Kie Workbench - Common - Data Model API 6.0.0.Beta5

org.kie.workbench.common.services.datamodel.oracle
Class ProjectDataModelOracleImpl

java.lang.Object
  extended by org.kie.workbench.common.services.datamodel.oracle.ProjectDataModelOracleImpl
All Implemented Interfaces:
ProjectDataModelOracle
Direct Known Subclasses:
PackageDataModelOracleImpl

@Portable
public class ProjectDataModelOracleImpl
extends Object
implements ProjectDataModelOracle

Default implementation of DataModelOracle


Field Summary
protected  Map<String,Boolean> projectCollectionTypes
           
protected  Map<String,Boolean> projectEventTypes
           
protected  Map<String,String> projectFieldParametersType
           
protected  Map<String,String[]> projectJavaEnumLists
           
protected  Map<String,List<MethodInfo>> projectMethodInformation
           
protected  Map<String,ModelField[]> projectModelFields
           
protected  String projectName
           
protected  Map<String,String> projectSuperTypes
           
protected  Map<String,Set<Annotation>> projectTypeAnnotations
           
protected  Map<String,Map<String,Set<Annotation>>> projectTypeFieldsAnnotations
           
protected  Map<String,org.guvnor.common.services.project.builder.model.TypeSource> projectTypeSources
           
 
Constructor Summary
ProjectDataModelOracleImpl()
           
 
Method Summary
 void addCollectionTypes(Map<String,Boolean> collectionTypes)
           
 void addEnumDefinitions(Map<String,String[]> dataEnumLists)
           
 void addEventTypes(Map<String,Boolean> eventTypes)
           
 void addFactsAndFields(Map<String,ModelField[]> modelFields)
           
 void addFieldParametersType(Map<String,String> fieldParametersType)
           
 void addMethodInformation(Map<String,List<MethodInfo>> methodInformation)
           
 void addSuperTypes(Map<String,String> superTypes)
           
 void addTypeAnnotations(Map<String,Set<Annotation>> annotations)
           
 void addTypeFieldsAnnotations(Map<String,Map<String,Set<Annotation>>> typeFieldsAnnotations)
           
 void addTypeSources(Map<String,org.guvnor.common.services.project.builder.model.TypeSource> typeSources)
           
 String[] getConnectiveOperatorCompletions(String factType, String fieldName)
          Get the Operators applicable for Connective Constraints
 DropDownData getEnums(String type, String field)
          Get enums for a Type and Field.
 DropDownData getEnums(String type, String field, Map<String,String> currentValueMap)
          Get enums for a Type and Field where the enum list may depend upon the values of other fields.
 String[] getEnumValues(String factType, String field)
          For simple cases - where a list of values are known based on a field.
 String getFactNameFromType(String type)
          Returns fact's name from class type
 String[] getFactTypes()
          Returns fact types available for rule authoring, i.e. those within the same package and those that have been imported.
 String getFieldClassName(String modelClassName, String fieldName)
           
 String[] getFieldCompletions(FieldAccessorsAndMutators accessorOrMutator, String factType)
           
 String[] getFieldCompletions(String factType)
           
 String getFieldType(String modelClassName, String fieldName)
           
 MethodInfo getMethodInfo(String factType, String methodFullName)
          Get information on a Method of a Fact Type
 List<String> getMethodNames(String factType)
          Get a list of Methods for a Fact Type
 List<String> getMethodNames(String factType, int paramCount)
          Get a list of Methods for a Fact Type that have at least the specified number of parameters
 List<String> getMethodParams(String factType, String methodNameWithParams)
          Get a list of parameters for a Method of a Fact Type
 Map<String,ModelField[]> getModelFields()
           
 String[] getOperatorCompletions(String factType, String fieldName)
          Get the Operators applicable Base Constraints
 String getParametricFieldType(String factType, String fieldName)
          Get the parametric type of a Field.
 Map<String,Boolean> getProjectCollectionTypes()
           
 Map<String,Boolean> getProjectEventTypes()
           
 Map<String,String> getProjectFieldParametersType()
           
 Map<String,String[]> getProjectJavaEnumLists()
           
 Map<String,List<MethodInfo>> getProjectMethodInformation()
           
 Map<String,String> getProjectSuperTypes()
           
 Map<String,org.guvnor.common.services.project.builder.model.TypeSource> getProjectTypeSources()
           
 String getSuperType(String factType)
          Get the Super Type for a given FactType
 Map<String,Set<Annotation>> getTypeAnnotations()
           
 Set<Annotation> getTypeAnnotations(String factType)
          Get the Annotations for a given FactType
 Map<String,Map<String,Set<Annotation>>> getTypeFieldsAnnotations()
           
 Map<String,Set<Annotation>> getTypeFieldsAnnotations(String factType)
          Get the Fields Annotations for a given FactType
 org.guvnor.common.services.project.builder.model.TypeSource getTypeSource(String factType)
          Return where a given FactType was defined
 boolean hasEnums(String qualifiedFactField)
           
 boolean hasEnums(String factType, String field)
           
 boolean isDependentEnum(String factType, String parentField, String childField)
          Check whether the childField is related to the parentField through a chain of enumeration dependencies.
 boolean isFactTypeAnEvent(String factType)
          Check whether a given FactType is an Event for CEP purposes
 boolean isFactTypeRecognized(String factType)
          Is the Fact Type known to the DataModelOracle
 void setProjectName(String projectName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

projectName

protected String projectName

projectModelFields

protected Map<String,ModelField[]> projectModelFields

projectFieldParametersType

protected Map<String,String> projectFieldParametersType

projectEventTypes

protected Map<String,Boolean> projectEventTypes

projectTypeSources

protected Map<String,org.guvnor.common.services.project.builder.model.TypeSource> projectTypeSources

projectSuperTypes

protected Map<String,String> projectSuperTypes

projectTypeAnnotations

protected Map<String,Set<Annotation>> projectTypeAnnotations

projectTypeFieldsAnnotations

protected Map<String,Map<String,Set<Annotation>>> projectTypeFieldsAnnotations

projectJavaEnumLists

protected Map<String,String[]> projectJavaEnumLists

projectMethodInformation

protected Map<String,List<MethodInfo>> projectMethodInformation

projectCollectionTypes

protected Map<String,Boolean> projectCollectionTypes
Constructor Detail

ProjectDataModelOracleImpl

public ProjectDataModelOracleImpl()
Method Detail

getFactTypes

public String[] getFactTypes()
Returns fact types available for rule authoring, i.e. those within the same package and those that have been imported.

Specified by:
getFactTypes in interface ProjectDataModelOracle
Returns:

getFactNameFromType

public String getFactNameFromType(String type)
Returns fact's name from class type

Specified by:
getFactNameFromType in interface ProjectDataModelOracle
Parameters:
type -
Returns:

isFactTypeRecognized

public boolean isFactTypeRecognized(String factType)
Is the Fact Type known to the DataModelOracle

Specified by:
isFactTypeRecognized in interface ProjectDataModelOracle
Parameters:
factType -
Returns:

isFactTypeAnEvent

public boolean isFactTypeAnEvent(String factType)
Check whether a given FactType is an Event for CEP purposes

Specified by:
isFactTypeAnEvent in interface ProjectDataModelOracle
Parameters:
factType -
Returns:

getTypeSource

public org.guvnor.common.services.project.builder.model.TypeSource getTypeSource(String factType)
Return where a given FactType was defined

Specified by:
getTypeSource in interface ProjectDataModelOracle
Parameters:
factType -
Returns:

getSuperType

public String getSuperType(String factType)
Get the Super Type for a given FactType

Specified by:
getSuperType in interface ProjectDataModelOracle
Parameters:
factType -
Returns:
null if no Super Type

getTypeAnnotations

public Set<Annotation> getTypeAnnotations(String factType)
Get the Annotations for a given FactType

Specified by:
getTypeAnnotations in interface ProjectDataModelOracle
Parameters:
factType -
Returns:
Empty Set if no annotations exist for the type

getTypeFieldsAnnotations

public Map<String,Set<Annotation>> getTypeFieldsAnnotations(String factType)
Get the Fields Annotations for a given FactType

Specified by:
getTypeFieldsAnnotations in interface ProjectDataModelOracle
Parameters:
factType -
Returns:
Empty Map if no annotations exist for the type

getModelFields

public Map<String,ModelField[]> getModelFields()
Specified by:
getModelFields in interface ProjectDataModelOracle

getFieldCompletions

public String[] getFieldCompletions(String factType)
Specified by:
getFieldCompletions in interface ProjectDataModelOracle

getFieldCompletions

public String[] getFieldCompletions(FieldAccessorsAndMutators accessorOrMutator,
                                    String factType)
Specified by:
getFieldCompletions in interface ProjectDataModelOracle

getFieldType

public String getFieldType(String modelClassName,
                           String fieldName)
Specified by:
getFieldType in interface ProjectDataModelOracle

getFieldClassName

public String getFieldClassName(String modelClassName,
                                String fieldName)
Specified by:
getFieldClassName in interface ProjectDataModelOracle

getParametricFieldType

public String getParametricFieldType(String factType,
                                     String fieldName)
Get the parametric type of a Field.

Specified by:
getParametricFieldType in interface ProjectDataModelOracle
Parameters:
factType -
fieldName -
Returns:

getOperatorCompletions

public String[] getOperatorCompletions(String factType,
                                       String fieldName)
Get the Operators applicable Base Constraints

Specified by:
getOperatorCompletions in interface ProjectDataModelOracle
Parameters:
factType -
fieldName -
Returns:

getConnectiveOperatorCompletions

public String[] getConnectiveOperatorCompletions(String factType,
                                                 String fieldName)
Get the Operators applicable for Connective Constraints

Specified by:
getConnectiveOperatorCompletions in interface ProjectDataModelOracle
Parameters:
factType -
fieldName -
Returns:

getEnums

public DropDownData getEnums(String type,
                             String field)
Get enums for a Type and Field.

Specified by:
getEnums in interface ProjectDataModelOracle

getEnums

public DropDownData getEnums(String type,
                             String field,
                             Map<String,String> currentValueMap)
Get enums for a Type and Field where the enum list may depend upon the values of other fields.

Specified by:
getEnums in interface ProjectDataModelOracle

getEnumValues

public String[] getEnumValues(String factType,
                              String field)
For simple cases - where a list of values are known based on a field.

Specified by:
getEnumValues in interface ProjectDataModelOracle

hasEnums

public boolean hasEnums(String factType,
                        String field)
Specified by:
hasEnums in interface ProjectDataModelOracle

hasEnums

public boolean hasEnums(String qualifiedFactField)
Specified by:
hasEnums in interface ProjectDataModelOracle

isDependentEnum

public boolean isDependentEnum(String factType,
                               String parentField,
                               String childField)
Check whether the childField is related to the parentField through a chain of enumeration dependencies. Both fields belong to the same Fact Type. Furthermore code consuming this function should ensure both parentField and childField relate to the same Fact Pattern

Specified by:
isDependentEnum in interface ProjectDataModelOracle
Parameters:
factType -
parentField -
childField -
Returns:

getMethodNames

public List<String> getMethodNames(String factType)
Get a list of Methods for a Fact Type

Specified by:
getMethodNames in interface ProjectDataModelOracle
Parameters:
factType -
Returns:

getMethodNames

public List<String> getMethodNames(String factType,
                                   int paramCount)
Get a list of Methods for a Fact Type that have at least the specified number of parameters

Specified by:
getMethodNames in interface ProjectDataModelOracle
Parameters:
factType -
paramCount -
Returns:

getMethodParams

public List<String> getMethodParams(String factType,
                                    String methodNameWithParams)
Get a list of parameters for a Method of a Fact Type

Specified by:
getMethodParams in interface ProjectDataModelOracle
Parameters:
factType -
methodNameWithParams -
Returns:

getMethodInfo

public MethodInfo getMethodInfo(String factType,
                                String methodFullName)
Get information on a Method of a Fact Type

Specified by:
getMethodInfo in interface ProjectDataModelOracle
Parameters:
factType -
methodFullName -
Returns:

setProjectName

public void setProjectName(String projectName)

addFactsAndFields

public void addFactsAndFields(Map<String,ModelField[]> modelFields)

addFieldParametersType

public void addFieldParametersType(Map<String,String> fieldParametersType)

addEventTypes

public void addEventTypes(Map<String,Boolean> eventTypes)

addTypeSources

public void addTypeSources(Map<String,org.guvnor.common.services.project.builder.model.TypeSource> typeSources)

addSuperTypes

public void addSuperTypes(Map<String,String> superTypes)

addTypeAnnotations

public void addTypeAnnotations(Map<String,Set<Annotation>> annotations)

addTypeFieldsAnnotations

public void addTypeFieldsAnnotations(Map<String,Map<String,Set<Annotation>>> typeFieldsAnnotations)

addEnumDefinitions

public void addEnumDefinitions(Map<String,String[]> dataEnumLists)

addMethodInformation

public void addMethodInformation(Map<String,List<MethodInfo>> methodInformation)

addCollectionTypes

public void addCollectionTypes(Map<String,Boolean> collectionTypes)

getProjectFieldParametersType

public Map<String,String> getProjectFieldParametersType()

getProjectEventTypes

public Map<String,Boolean> getProjectEventTypes()

getProjectTypeSources

public Map<String,org.guvnor.common.services.project.builder.model.TypeSource> getProjectTypeSources()

getProjectSuperTypes

public Map<String,String> getProjectSuperTypes()

getTypeAnnotations

public Map<String,Set<Annotation>> getTypeAnnotations()

getTypeFieldsAnnotations

public Map<String,Map<String,Set<Annotation>>> getTypeFieldsAnnotations()

getProjectJavaEnumLists

public Map<String,String[]> getProjectJavaEnumLists()

getProjectMethodInformation

public Map<String,List<MethodInfo>> getProjectMethodInformation()

getProjectCollectionTypes

public Map<String,Boolean> getProjectCollectionTypes()

Kie Workbench - Common - Data Model API 6.0.0.Beta5

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.