Package org.drools.drl.parser.lang.dsl
Class DefaultDSLMapping
- java.lang.Object
-
- org.drools.drl.parser.lang.dsl.DefaultDSLMapping
-
- All Implemented Interfaces:
DSLMapping
public class DefaultDSLMapping extends Object implements DSLMapping
This is a default implementation of the DSL Mapping interface capable of storing a list of DSLMappingEntries and managing it.
-
-
Constructor Summary
Constructors Constructor Description DefaultDSLMapping()DefaultDSLMapping(String identifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntries(List<DSLMappingEntry> entries)Adds all entries in the given list to this DSL MappingvoidaddEntry(DSLMappingEntry entry)Add one entry to the list of the entriesStringgetDescription()Returns a String description of this mappingList<DSLMappingEntry>getEntries()Returns an unmodifiable list of entriesList<DSLMappingEntry>getEntries(DSLMappingEntry.Section section)Returns the list of mappings for the given sectionStringgetIdentifier()Returns the identifier for this mappingbooleangetOption(String option)Retrieves an an expansion option.voidremoveEntry(DSLMappingEntry entry)Removes the given entry from the list of entriesvoidsetDescription(String description)Sets the description for this mappingvoidsetIdentifier(String identifier)Sets the identifier for this mappingvoidsetOptions(Collection<String> option)Sets an expansion option.
-
-
-
Constructor Detail
-
DefaultDSLMapping
public DefaultDSLMapping()
-
DefaultDSLMapping
public DefaultDSLMapping(String identifier)
-
-
Method Detail
-
addEntry
public void addEntry(DSLMappingEntry entry)
Add one entry to the list of the entries- Specified by:
addEntryin interfaceDSLMapping- Parameters:
entry-
-
addEntries
public void addEntries(List<DSLMappingEntry> entries)
Adds all entries in the given list to this DSL Mapping- Specified by:
addEntriesin interfaceDSLMapping- Parameters:
entries-
-
getEntries
public List<DSLMappingEntry> getEntries()
Returns an unmodifiable list of entries- Specified by:
getEntriesin interfaceDSLMapping- Returns:
-
getEntries
public List<DSLMappingEntry> getEntries(DSLMappingEntry.Section section)
Returns the list of mappings for the given section- Specified by:
getEntriesin interfaceDSLMapping- Parameters:
section-- Returns:
-
getIdentifier
public String getIdentifier()
Returns the identifier for this mapping- Specified by:
getIdentifierin interfaceDSLMapping- Returns:
-
removeEntry
public void removeEntry(DSLMappingEntry entry)
Description copied from interface:DSLMappingRemoves the given entry from the list of entries- Specified by:
removeEntryin interfaceDSLMapping
-
getDescription
public String getDescription()
Description copied from interface:DSLMappingReturns a String description of this mapping- Specified by:
getDescriptionin interfaceDSLMapping- Returns:
-
setDescription
public void setDescription(String description)
Description copied from interface:DSLMappingSets the description for this mapping- Specified by:
setDescriptionin interfaceDSLMapping
-
setIdentifier
public void setIdentifier(String identifier)
Description copied from interface:DSLMappingSets the identifier for this mapping- Specified by:
setIdentifierin interfaceDSLMapping
-
setOptions
public void setOptions(Collection<String> option)
Description copied from interface:DSLMappingSets an expansion option.- Specified by:
setOptionsin interfaceDSLMapping
-
getOption
public boolean getOption(String option)
Description copied from interface:DSLMappingRetrieves an an expansion option.- Specified by:
getOptionin interfaceDSLMapping- Returns:
- true if option is set.
-
-