Package org.drools.compiler.lang.dsl
Class DefaultDSLMapping
- java.lang.Object
-
- org.drools.compiler.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 void
addEntries(List<DSLMappingEntry> entries)
Adds all entries in the given list to this DSL Mappingvoid
addEntry(DSLMappingEntry entry)
Add one entry to the list of the entriesString
getDescription()
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 sectionString
getIdentifier()
Returns the identifier for this mappingboolean
getOption(String option)
Retrieves an an expansion option.void
removeEntry(DSLMappingEntry entry)
Removes the given entry from the list of entriesvoid
setDescription(String description)
Sets the description for this mappingvoid
setIdentifier(String identifier)
Sets the identifier for this mappingvoid
setOptions(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:
addEntry
in interfaceDSLMapping
- Parameters:
entry
-
-
addEntries
public void addEntries(List<DSLMappingEntry> entries)
Adds all entries in the given list to this DSL Mapping- Specified by:
addEntries
in interfaceDSLMapping
- Parameters:
entries
-
-
getEntries
public List<DSLMappingEntry> getEntries()
Returns an unmodifiable list of entries- Specified by:
getEntries
in interfaceDSLMapping
- Returns:
-
getEntries
public List<DSLMappingEntry> getEntries(DSLMappingEntry.Section section)
Returns the list of mappings for the given section- Specified by:
getEntries
in interfaceDSLMapping
- Parameters:
section
-- Returns:
-
getIdentifier
public String getIdentifier()
Returns the identifier for this mapping- Specified by:
getIdentifier
in interfaceDSLMapping
- Returns:
-
removeEntry
public void removeEntry(DSLMappingEntry entry)
Description copied from interface:DSLMapping
Removes the given entry from the list of entries- Specified by:
removeEntry
in interfaceDSLMapping
-
getDescription
public String getDescription()
Description copied from interface:DSLMapping
Returns a String description of this mapping- Specified by:
getDescription
in interfaceDSLMapping
- Returns:
-
setDescription
public void setDescription(String description)
Description copied from interface:DSLMapping
Sets the description for this mapping- Specified by:
setDescription
in interfaceDSLMapping
-
setIdentifier
public void setIdentifier(String identifier)
Description copied from interface:DSLMapping
Sets the identifier for this mapping- Specified by:
setIdentifier
in interfaceDSLMapping
-
setOptions
public void setOptions(Collection<String> option)
Description copied from interface:DSLMapping
Sets an expansion option.- Specified by:
setOptions
in interfaceDSLMapping
-
getOption
public boolean getOption(String option)
Description copied from interface:DSLMapping
Retrieves an an expansion option.- Specified by:
getOption
in interfaceDSLMapping
- Returns:
- true if option is set.
-
-