Class BaseFields

All Implemented Interfaces:
io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.type.CodeType, io.github.mmm.code.api.member.CodeFields>, 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.member.CodeFields, io.github.mmm.code.api.member.CodeMembers<io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.merge.CodeAdvancedMergeableItem<io.github.mmm.code.api.member.CodeFields>, io.github.mmm.code.api.merge.CodeMergeableItem<io.github.mmm.code.api.member.CodeFields>, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeContainer<io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.node.CodeNodeItemContainer<io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.node.CodeNodeItemContainerHierarchical<io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.node.CodeNodeItemContainerHierarchicalWithName<io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.node.CodeNodeItemContainerWithName<io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.object.CodeMutable, Iterable<io.github.mmm.code.api.member.CodeField>

public class BaseFields extends BaseMembers<io.github.mmm.code.api.member.CodeField> implements io.github.mmm.code.api.member.CodeFields
Base implementation of CodeFields.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Constructor Details

    • BaseFields

      public BaseFields(BaseType parent)
      The constructor.
      Parameters:
      parent - the parent.
    • BaseFields

      public BaseFields(BaseFields template, io.github.mmm.code.api.copy.CodeCopyMapper mapper)
      The copy-constructor.
      Parameters:
      template - the BaseFields 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
    • getAll

      public Iterable<? extends io.github.mmm.code.api.member.CodeField> getAll()
      Specified by:
      getAll in interface io.github.mmm.code.api.node.CodeNodeItemContainerHierarchical<io.github.mmm.code.api.member.CodeField>
    • getDeclared

      public io.github.mmm.code.api.member.CodeField getDeclared(String name)
      Specified by:
      getDeclared in interface io.github.mmm.code.api.node.CodeNodeItemContainerWithName<io.github.mmm.code.api.member.CodeField>
    • get

      public io.github.mmm.code.api.member.CodeField get(String name)
      Specified by:
      get in interface io.github.mmm.code.api.node.CodeNodeItemContainerWithName<io.github.mmm.code.api.member.CodeField>
    • add

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

      public io.github.mmm.code.api.member.CodeFields getSourceCodeObject()
      Specified by:
      getSourceCodeObject in class BaseMembers<io.github.mmm.code.api.member.CodeField>
      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.
    • merge

      public io.github.mmm.code.api.member.CodeFields merge(io.github.mmm.code.api.member.CodeFields o, io.github.mmm.code.api.merge.CodeMergeStrategyDecider decider, io.github.mmm.code.api.merge.CodeMergeStrategy parentStrategy)
      Specified by:
      merge in interface io.github.mmm.code.api.merge.CodeAdvancedMergeableItem<io.github.mmm.code.api.member.CodeFields>
    • copy

      public BaseFields copy()
      Specified by:
      copy in interface io.github.mmm.code.api.member.CodeFields
      Specified by:
      copy in interface io.github.mmm.code.api.member.CodeMembers<io.github.mmm.code.api.member.CodeField>
      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.member.CodeField>
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItemContainerHierarchical<io.github.mmm.code.api.member.CodeField>
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItemContainerHierarchicalWithName<io.github.mmm.code.api.member.CodeField>
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItemContainerWithName<io.github.mmm.code.api.member.CodeField>
      Specified by:
      copy in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.type.CodeType, io.github.mmm.code.api.member.CodeFields>
      Specified by:
      copy in class BaseMembers<io.github.mmm.code.api.member.CodeField>
    • copy

      public BaseFields 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.member.CodeField>
      Specified by:
      copy in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.type.CodeType, io.github.mmm.code.api.member.CodeFields>
    • doWrite

      protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException
      Overrides:
      doWrite in class BaseMembers<io.github.mmm.code.api.member.CodeField>
      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)