org.drools.ide.common.server.util
Class SuggestionCompletionEngineBuilder

java.lang.Object
  extended by org.drools.ide.common.server.util.SuggestionCompletionEngineBuilder

public class SuggestionCompletionEngineBuilder
extends Object

A builder to incrementally populate a SuggestionCompletionEngine


Constructor Summary
SuggestionCompletionEngineBuilder()
           
 
Method Summary
 void addAllDataEnumsList(Map<String,String[]> data)
           
 void addAnnotationsForType(String factType, Map<String,Map<String,String>> annotations)
          Adds the annotations for a given type
 void addDSLActionSentence(String definition)
          Add a DSL sentence for an action.
 void addDSLConditionSentence(String definition)
          Add a DSL sentence for a condition.
 void addDSLMapping(org.drools.lang.dsl.DSLMappingEntry entry)
           
 void addFactType(String factType, ModelField.FIELD_CLASS_TYPE type)
          Adds a fact type to the engine
 void addFieldAccessorsAndMutatorsForField(Map<String,FieldAccessorsAndMutators> accessorsAndMutators)
           
 void addFieldsForType(String type, String[] fields)
          Adds the list of fields for a given type
 void addFieldType(String field, String type, Class<?> clazz)
          Adds a type declaration for a field
 void addFieldTypeField(String field, Field type)
          Adds a type declaration for a field
 void addGlobalCollection(String global)
           
 void addGlobalType(String global, String type)
          Adds a global and its corresponding type to the engine
 void addModifiersForType(String type, String[] fields)
          Adds the list of modifiers for a given type
 SuggestionCompletionEngine getInstance()
          Returns a SuggestionCompletionEngine instance populated with all the data since last call to newCompletionEngine() method
 boolean hasFieldsForType(String type)
           
 void newCompletionEngine()
          Start the creation of a new SuggestionCompletionEngine
static String obtainGenericType(Type type)
           
 void putParametricFieldType(String fieldName, String genericType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuggestionCompletionEngineBuilder

public SuggestionCompletionEngineBuilder()
Method Detail

newCompletionEngine

public void newCompletionEngine()
Start the creation of a new SuggestionCompletionEngine


addFactType

public void addFactType(String factType,
                        ModelField.FIELD_CLASS_TYPE type)
Adds a fact type to the engine

Parameters:
factType -

addAnnotationsForType

public void addAnnotationsForType(String factType,
                                  Map<String,Map<String,String>> annotations)
Adds the annotations for a given type

Parameters:
factType -
annotations -

addFieldsForType

public void addFieldsForType(String type,
                             String[] fields)
Adds the list of fields for a given type

Parameters:
type -
fields -

addModifiersForType

public void addModifiersForType(String type,
                                String[] fields)
Adds the list of modifiers for a given type

Parameters:
type -
fields -

hasFieldsForType

public boolean hasFieldsForType(String type)
Returns:
true if this has the type already registered (field information).

addFieldType

public void addFieldType(String field,
                         String type,
                         Class<?> clazz)
Adds a type declaration for a field

Parameters:
field - format: class.field
type - parametrized type of clazz
clazz - the class of field

addFieldTypeField

public void addFieldTypeField(String field,
                              Field type)
Adds a type declaration for a field

Parameters:
field - format: class.field
type -

addGlobalType

public void addGlobalType(String global,
                          String type)
Adds a global and its corresponding type to the engine

Parameters:
global -
type -

addGlobalCollection

public void addGlobalCollection(String global)

addDSLActionSentence

public void addDSLActionSentence(String definition)
Add a DSL sentence for an action.


addDSLConditionSentence

public void addDSLConditionSentence(String definition)
Add a DSL sentence for a condition.


obtainGenericType

public static String obtainGenericType(Type type)

putParametricFieldType

public void putParametricFieldType(String fieldName,
                                   String genericType)

getInstance

public SuggestionCompletionEngine getInstance()
Returns a SuggestionCompletionEngine instance populated with all the data since last call to newCompletionEngine() method

Returns:

addDSLMapping

public void addDSLMapping(org.drools.lang.dsl.DSLMappingEntry entry)

addFieldAccessorsAndMutatorsForField

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

addAllDataEnumsList

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


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