Class BaseParameters

All Implemented Interfaces:
io.github.mmm.code.api.arg.CodeOperationArgs<io.github.mmm.code.api.arg.CodeParameter>, io.github.mmm.code.api.arg.CodeParameters, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeOperation, io.github.mmm.code.api.arg.CodeParameters>, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithDeclaringType, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.merge.CodeMergeableItem<io.github.mmm.code.api.arg.CodeParameters>, io.github.mmm.code.api.merge.CodeSimpleMergeableItem<io.github.mmm.code.api.arg.CodeParameters>, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeContainer<io.github.mmm.code.api.arg.CodeParameter>, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.node.CodeNodeItemContainer<io.github.mmm.code.api.arg.CodeParameter>, io.github.mmm.code.api.node.CodeNodeItemContainerFlat<io.github.mmm.code.api.arg.CodeParameter>, io.github.mmm.code.api.node.CodeNodeItemContainerFlatWithName<io.github.mmm.code.api.arg.CodeParameter>, io.github.mmm.code.api.node.CodeNodeItemContainerWithName<io.github.mmm.code.api.arg.CodeParameter>, io.github.mmm.code.api.object.CodeMutable, Iterable<io.github.mmm.code.api.arg.CodeParameter>

public class BaseParameters extends BaseOperationArgs<io.github.mmm.code.api.arg.CodeParameter> implements io.github.mmm.code.api.arg.CodeParameters
Base implementation of CodeParameters.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Constructor Details

    • BaseParameters

      public BaseParameters(BaseOperation parent)
      The constructor.
      Parameters:
      parent - the parent.
    • BaseParameters

      public BaseParameters(BaseParameters template, io.github.mmm.code.api.copy.CodeCopyMapper mapper)
      The copy-constructor.
      Parameters:
      template - the BaseParameters to copy.
      mapper - the CodeCopyMapper.
  • Method Details

    • doInitialize

      protected void doInitialize()
      Description copied from class: BaseNodeItem
      Called from BaseMutableItem.initialize() on first invocation. May be overridden but never be called from anywhere else.
      Overrides:
      doInitialize in class BaseNodeItem
    • getDeclared

      public io.github.mmm.code.api.arg.CodeParameter getDeclared(String name)
      Specified by:
      getDeclared in interface io.github.mmm.code.api.node.CodeNodeItemContainerWithName<io.github.mmm.code.api.arg.CodeParameter>
    • add

      public io.github.mmm.code.api.arg.CodeParameter add(String name)
      Specified by:
      add in interface io.github.mmm.code.api.node.CodeNodeItemContainerWithName<io.github.mmm.code.api.arg.CodeParameter>
    • getSourceCodeObject

      public io.github.mmm.code.api.arg.CodeParameters getSourceCodeObject()
      Specified by:
      getSourceCodeObject in class BaseOperationArgs<io.github.mmm.code.api.arg.CodeParameter>
      Returns:
      the optional internal CodeItem representing the source-code (to merge). Otherwise null. This is an internal API. Do not use or rely on it from outside.
    • rename

      protected void rename(io.github.mmm.code.api.arg.CodeParameter child, String oldName, String newName, Consumer<String> renamer)
      Overrides:
      rename in class BaseNodeItemContainer<io.github.mmm.code.api.arg.CodeParameter>
      Parameters:
      child - the child to rename.
      oldName - the old name.
      newName - the new name to be set.
      renamer - the Consumer to actually perform the renaming (that may change the Object.hashCode() of the child).
    • merge

      public io.github.mmm.code.api.arg.CodeParameters merge(io.github.mmm.code.api.arg.CodeParameters o, io.github.mmm.code.api.merge.CodeMergeStrategy strategy)
      Specified by:
      merge in interface io.github.mmm.code.api.merge.CodeSimpleMergeableItem<io.github.mmm.code.api.arg.CodeParameters>
    • copy

      public BaseParameters copy()
      Specified by:
      copy in interface io.github.mmm.code.api.item.CodeMutableItem
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItem
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItemContainer<io.github.mmm.code.api.arg.CodeParameter>
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItemContainerFlat<io.github.mmm.code.api.arg.CodeParameter>
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItemContainerFlatWithName<io.github.mmm.code.api.arg.CodeParameter>
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItemContainerWithName<io.github.mmm.code.api.arg.CodeParameter>
      Specified by:
      copy in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeOperation, io.github.mmm.code.api.arg.CodeParameters>
      Specified by:
      copy in interface io.github.mmm.code.api.arg.CodeOperationArgs<io.github.mmm.code.api.arg.CodeParameter>
      Specified by:
      copy in interface io.github.mmm.code.api.arg.CodeParameters
      Specified by:
      copy in class BaseOperationArgs<io.github.mmm.code.api.arg.CodeParameter>
    • copy

      public BaseParameters copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper)
      Specified by:
      copy in interface io.github.mmm.code.api.item.CodeMutableItem
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItem
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItemContainer<io.github.mmm.code.api.arg.CodeParameter>
      Specified by:
      copy in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeOperation, io.github.mmm.code.api.arg.CodeParameters>
    • doWrite

      protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException
      Specified by:
      doWrite in class BaseItem
      Parameters:
      sink - the Appendable where to append the code from this CodeItem.
      newline - the newline String.
      defaultIndent - the String used for indentation (e.g. a number of spaces to insert per indent level).
      currentIndent - the current indent (number of spaces). Initially the empty string (""). Before a recursion the defaultIndent will be appended.
      language - the CodeLanguage to use.
      Throws:
      IOException - if thrown by Appendable.
      See Also:
      • CodeItem.write(Appendable, String, String)