org.drools.ide.common.client.modeldriven
Class SuggestionCompletionEngine

java.lang.Object
  extended by org.drools.ide.common.client.modeldriven.SuggestionCompletionEngine
All Implemented Interfaces:
Serializable, PortableObject

public class SuggestionCompletionEngine
extends Object
implements PortableObject

An suggestion completion processor. This should be usable in both GWT/Web and the IDE. The data for this can be loaded into this from simple string lists.

See Also:
Serialized Form

Field Summary
 DSLSentence[] actionDSLSentences
           
 DSLSentence[] anyScopeDSLItems
           
 DSLSentence[] conditionDSLSentences
          DSL language extensions, if needed, if provided by the package.
 DSLSentence[] keywordDSLItems
           
static String TYPE_BOOLEAN
           
static String TYPE_COLLECTION
          These are the explicit types supported
static String TYPE_COMPARABLE
           
static String TYPE_DATE
           
static String TYPE_FINAL_OBJECT
           
static String TYPE_NUMERIC
           
static String TYPE_OBJECT
           
static String TYPE_STRING
           
 
Constructor Summary
SuggestionCompletionEngine()
           
 
Method Summary
 void addMethodInfo(String factName, List<MethodInfo> methodInfos)
           
 boolean containsFactType(String modelClassName)
           
 String[] getConditionalElements()
           
 String[] getConnectiveOperatorCompletions(String factType, String fieldName)
           
 String[] getDataEnumList(String type)
           
 int getDataEnumListsSize()
           
 DSLSentence[] getDSLActions()
           
 DSLSentence[] getDSLConditions()
           
 DropDownData getEnums(FactPattern pat, String field)
          This returns a list of enums options (values) that can be used for the given field of the given FactPattern.
 DropDownData getEnums(String type, FieldNature[] currentValues, String field)
          Similar to the one above - but this one is for RHS.
 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 all the fact types.
 String getFieldClassName(String propertyName)
           
 String getFieldClassName(String modelClassName, String fieldName)
           
 ModelField.FIELD_CLASS_TYPE getFieldClassType(String modelClassName, String fieldName)
           
 String[] getFieldCompletions(FieldAccessorsAndMutators accessorOrMutator, String factType)
           
 String[] getFieldCompletions(String factType)
           
 String[] getFieldCompletionsForGlobalVariable(String varName)
           
 String getFieldType(String propertyName)
           
 String getFieldType(String modelClassName, String fieldName)
           
 String[] getGlobalCollections()
           
 String getGlobalVariable(String name)
           
 String[] getGlobalVariables()
           
 String getMethodClassType(String factName, String methodFullName)
           
 List<String> getMethodFullNames(String factName)
           
 List<String> getMethodFullNames(String factName, int paramCount)
           
 MethodInfo getMethodinfo(String factName, String methodFullName)
           
 List<MethodInfo> getMethodInfosForGlobalVariable(String varName)
           
 List<String> getMethodNames(String factName)
           
 List<String> getMethodParams(String factName, String methodNameWithParams)
           
 Map<String,ModelField[]> getModelFields()
           
 String[] getModelFields(FieldAccessorsAndMutators accessorOrMutator, String modelClassName)
           
 String[] getModelFields(String modelClassName)
           
 String[] getModifiers(String name)
           
 String[] getOperatorCompletions(String type)
           
 String[] getOperatorCompletions(String factType, String fieldName)
           
 String getParametricFieldType(String fieldName)
           
 String getParametricFieldType(String factType, String fieldName)
          returns the type of parametric class List a in a class called Toto key = "Toto.a" value = "String"
 boolean hasDataEnumLists()
           
 boolean isFilteringFacts()
           
 boolean isGlobalVariable(String name)
           
 void putAllDataEnumLists(Map<String,String[]> value)
           
 void putDataEnumList(String name, String[] value)
           
 void putParametricFieldType(String fieldName, String type)
           
 void setAccessorsAndMutators(Map<String,FieldAccessorsAndMutators> accessorsAndMutators)
           
 void setDataEnumLists(Map<String,String[]> data)
           
 void setFactTypeFilter(FactTypeFilter filter)
           
 void setFactTypes(String[] factTypes)
           
 void setFieldsForTypes(Map<String,ModelField[]> fieldsForType)
           
 void setFilteringFacts(boolean filterFacts)
           
 void setGlobalCollections(String[] globalCollections)
           
 void setGlobalVariables(Map<String,String> globalTypes)
           
 void setModelFields(Map<String,ModelField[]> modelFields)
           
 void setModifiers(Map<String,String[]> map)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_COLLECTION

public static final String TYPE_COLLECTION
These are the explicit types supported

See Also:
Constant Field Values

TYPE_COMPARABLE

public static final String TYPE_COMPARABLE
See Also:
Constant Field Values

TYPE_STRING

public static final String TYPE_STRING
See Also:
Constant Field Values

TYPE_NUMERIC

public static final String TYPE_NUMERIC
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final String TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_DATE

public static final String TYPE_DATE
See Also:
Constant Field Values

TYPE_OBJECT

public static final String TYPE_OBJECT
See Also:
Constant Field Values

TYPE_FINAL_OBJECT

public static final String TYPE_FINAL_OBJECT
See Also:
Constant Field Values

conditionDSLSentences

public DSLSentence[] conditionDSLSentences
DSL language extensions, if needed, if provided by the package.


actionDSLSentences

public DSLSentence[] actionDSLSentences

keywordDSLItems

public DSLSentence[] keywordDSLItems

anyScopeDSLItems

public DSLSentence[] anyScopeDSLItems
Constructor Detail

SuggestionCompletionEngine

public SuggestionCompletionEngine()
Method Detail

getConditionalElements

public String[] getConditionalElements()

getDSLConditions

public DSLSentence[] getDSLConditions()

getDSLActions

public DSLSentence[] getDSLActions()

getConnectiveOperatorCompletions

public String[] getConnectiveOperatorCompletions(String factType,
                                                 String fieldName)

getFieldCompletions

public String[] getFieldCompletions(String factType)

getFieldCompletions

public String[] getFieldCompletions(FieldAccessorsAndMutators accessorOrMutator,
                                    String factType)

getOperatorCompletions

public String[] getOperatorCompletions(String factType,
                                       String fieldName)

getOperatorCompletions

public String[] getOperatorCompletions(String type)

getFieldCompletionsForGlobalVariable

public String[] getFieldCompletionsForGlobalVariable(String varName)

getMethodInfosForGlobalVariable

public List<MethodInfo> getMethodInfosForGlobalVariable(String varName)

getEnums

public DropDownData getEnums(FactPattern pat,
                             String field)
This returns a list of enums options (values) that can be used for the given field of the given FactPattern. This also takes into account enums that depend on other fields.


getEnums

public DropDownData getEnums(String type,
                             FieldNature[] currentValues,
                             String field)
Similar to the one above - but this one is for RHS.


getEnumValues

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


addMethodInfo

public void addMethodInfo(String factName,
                          List<MethodInfo> methodInfos)

getMethodParams

public List<String> getMethodParams(String factName,
                                    String methodNameWithParams)

getMethodNames

public List<String> getMethodNames(String factName)

getMethodinfo

public MethodInfo getMethodinfo(String factName,
                                String methodFullName)

getMethodClassType

public String getMethodClassType(String factName,
                                 String methodFullName)

getMethodFullNames

public List<String> getMethodFullNames(String factName)

getMethodFullNames

public List<String> getMethodFullNames(String factName,
                                       int paramCount)

getFactNameFromType

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

Parameters:
type -
Returns:

getParametricFieldType

public String getParametricFieldType(String factType,
                                     String fieldName)
returns the type of parametric class List a in a class called Toto key = "Toto.a" value = "String"


getParametricFieldType

public String getParametricFieldType(String fieldName)

putParametricFieldType

public void putParametricFieldType(String fieldName,
                                   String type)

getGlobalVariable

public String getGlobalVariable(String name)

isGlobalVariable

public boolean isGlobalVariable(String name)

setGlobalVariables

public void setGlobalVariables(Map<String,String> globalTypes)

getGlobalVariables

public String[] getGlobalVariables()

setModifiers

public void setModifiers(Map<String,String[]> map)

getModifiers

public String[] getModifiers(String name)

setGlobalCollections

public void setGlobalCollections(String[] globalCollections)

getGlobalCollections

public String[] getGlobalCollections()

getDataEnumList

public String[] getDataEnumList(String type)

setDataEnumLists

public void setDataEnumLists(Map<String,String[]> data)

putDataEnumList

public void putDataEnumList(String name,
                            String[] value)

putAllDataEnumLists

public void putAllDataEnumLists(Map<String,String[]> value)

getDataEnumListsSize

public int getDataEnumListsSize()

hasDataEnumLists

public boolean hasDataEnumLists()

setFactTypes

public void setFactTypes(String[] factTypes)

setFactTypeFilter

public void setFactTypeFilter(FactTypeFilter filter)

setFieldsForTypes

public void setFieldsForTypes(Map<String,ModelField[]> fieldsForType)

getFactTypes

public String[] getFactTypes()
Returns all the fact types.

Returns:

containsFactType

public boolean containsFactType(String modelClassName)

getModelFields

public String[] getModelFields(FieldAccessorsAndMutators accessorOrMutator,
                               String modelClassName)

getModelFields

public String[] getModelFields(String modelClassName)

getFieldClassName

public String getFieldClassName(String propertyName)
Parameters:
propertyName - of the type class.field
Returns:

getFieldClassName

public String getFieldClassName(String modelClassName,
                                String fieldName)

getFieldClassType

public ModelField.FIELD_CLASS_TYPE getFieldClassType(String modelClassName,
                                                     String fieldName)

getFieldType

public String getFieldType(String propertyName)

getFieldType

public String getFieldType(String modelClassName,
                           String fieldName)

setAccessorsAndMutators

public void setAccessorsAndMutators(Map<String,FieldAccessorsAndMutators> accessorsAndMutators)

setModelFields

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

getModelFields

public Map<String,ModelField[]> getModelFields()

isFilteringFacts

public boolean isFilteringFacts()

setFilteringFacts

public void setFilteringFacts(boolean filterFacts)


Copyright © 2001-2011 JBoss Inc.. All Rights Reserved.