Package de.spraener.nxtgen.target
Class UniqueLineSection
java.lang.Object
de.spraener.nxtgen.target.AbstractCodeSection
de.spraener.nxtgen.target.UniqueLineSection
- All Implemented Interfaces:
CodeSection
- Direct Known Subclasses:
JavaImplementsCodeSection
This section evaluates, so that there is no duplicate line. It can be used to
generate import statements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(CodeSnippet snippet) insertAfter(CodeSnippet snippet, CodeSnippet snippetToInsert) insertBefore(CodeSnippet snippet, CodeSnippet snippetToInsert) replace(CodeSnippet snippet, CodeSnippet snippetToInsert) DANGER!withSnippet(Object key, CodeSnippet snippet) Methods inherited from class de.spraener.nxtgen.target.AbstractCodeSection
add, add, getFirstSnippetForAspect, getFirstSnippetForAspectAndModelElement, getLastSnippetForAspect, getLastSnippetForAspectAndModelElement, getSnippetsForAspect, getSnippetsForAspectAndModelElement, getSnippetsOrdered, withSnippet
-
Constructor Details
-
UniqueLineSection
public UniqueLineSection()
-
-
Method Details
-
withSnippet
- Overrides:
withSnippetin classAbstractCodeSection
-
add
- Specified by:
addin interfaceCodeSection- Overrides:
addin classAbstractCodeSection
-
insertBefore
- Specified by:
insertBeforein interfaceCodeSection- Overrides:
insertBeforein classAbstractCodeSection
-
insertAfter
- Specified by:
insertAfterin interfaceCodeSection- Overrides:
insertAfterin classAbstractCodeSection
-
replace
Description copied from interface:CodeSectionDANGER! This replace-method will REPLACE! the snippet with the snippetToInsert. Only use this method when you are really sure to do so. The aspect of the snippetToInsert will be overwritten with the aspect of the replaced snippet. USE WITH CARE!- Specified by:
replacein interfaceCodeSection- Overrides:
replacein classAbstractCodeSection- Parameters:
snippet- the snippet to be replaced and to take the aspect fromsnippetToInsert- the snippet to replace the old snippet and get the aspect from the old snippet.- Returns:
- the CodeSection with replaced snippet.
-