Class BaseProperty

All Implemented Interfaces:
io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeProperties, io.github.mmm.code.api.member.CodeProperty>, io.github.mmm.code.api.element.CodeElement, io.github.mmm.code.api.element.CodeElementWithDeclaringType, io.github.mmm.code.api.element.CodeElementWithModifiers, io.github.mmm.code.api.element.CodeElementWithName, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithComment, io.github.mmm.code.api.item.CodeItemWithDeclaringType, io.github.mmm.code.api.item.CodeItemWithModifiers, io.github.mmm.code.api.item.CodeItemWithName, io.github.mmm.code.api.item.CodeItemWithType, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.item.CodeMutableItemWithComment, io.github.mmm.code.api.item.CodeMutableItemWithType, io.github.mmm.code.api.member.CodeMember, io.github.mmm.code.api.member.CodeProperty, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.object.CodeMutable

public class BaseProperty extends BaseMember implements io.github.mmm.code.api.member.CodeProperty
Base implementation of CodeProperty.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Constructor Details

    • BaseProperty

      public BaseProperty(BaseProperties parent, String name)
      The constructor.
      Parameters:
      parent - the parent.
      name - the name.
    • BaseProperty

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

    • getParent

      public BaseProperties getParent()
      Specified by:
      getParent in interface io.github.mmm.code.api.member.CodeMember
      Specified by:
      getParent in interface io.github.mmm.code.api.node.CodeNode
      Specified by:
      getParent in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeProperties, io.github.mmm.code.api.member.CodeProperty>
      Specified by:
      getParent in class BaseMember
    • getModifiers

      public io.github.mmm.code.api.modifier.CodeModifiers getModifiers()
      Specified by:
      getModifiers in interface io.github.mmm.code.api.item.CodeItemWithModifiers
      Overrides:
      getModifiers in class BaseElementWithModifiers
    • setModifiers

      @Deprecated public void setModifiers(io.github.mmm.code.api.modifier.CodeModifiers modifiers)
      Deprecated.
      see CodeProperty.setModifiers(CodeModifiers).
      Specified by:
      setModifiers in interface io.github.mmm.code.api.element.CodeElementWithModifiers
      Specified by:
      setModifiers in interface io.github.mmm.code.api.member.CodeProperty
      Overrides:
      setModifiers in class BaseElementWithModifiers
    • getField

      public io.github.mmm.code.api.member.CodeField getField()
      Specified by:
      getField in interface io.github.mmm.code.api.member.CodeProperty
    • getGetter

      public io.github.mmm.code.api.member.CodeMethod getGetter()
      Specified by:
      getGetter in interface io.github.mmm.code.api.member.CodeProperty
    • getSetter

      public io.github.mmm.code.api.member.CodeMethod getSetter()
      Specified by:
      getSetter in interface io.github.mmm.code.api.member.CodeProperty
    • getReflectiveObject

      @Deprecated public AccessibleObject getReflectiveObject()
      Deprecated.
      a BaseProperty is a virtual object that can never have a reflective object. Use that method on getField(), getGetter(), or getSetter() instead.
      Specified by:
      getReflectiveObject in interface io.github.mmm.code.api.member.CodeMember
      Specified by:
      getReflectiveObject in interface io.github.mmm.code.api.item.CodeMutableItem
      Specified by:
      getReflectiveObject in class BaseMember
    • getSourceCodeObject

      @Deprecated public BaseProperty getSourceCodeObject()
      Deprecated.
      a BaseProperty is a virtual object that can never have a source-code object. Use that method on getField(), getGetter(), or getSetter() instead.
      Specified by:
      getSourceCodeObject in class BaseMember
      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.
    • inherit

      public BaseProperty inherit(io.github.mmm.code.api.type.CodeType declaring)
      Specified by:
      inherit in interface io.github.mmm.code.api.member.CodeProperty
    • isReadable

      public boolean isReadable(io.github.mmm.code.api.modifier.CodeVisibility visibility)
      Specified by:
      isReadable in interface io.github.mmm.code.api.member.CodeProperty
    • isWritable

      public boolean isWritable(io.github.mmm.code.api.modifier.CodeVisibility visibility)
      Specified by:
      isWritable in interface io.github.mmm.code.api.member.CodeProperty
    • getType

      public io.github.mmm.code.api.type.CodeGenericType getType()
      Specified by:
      getType in interface io.github.mmm.code.api.item.CodeItemWithType
    • setType

      public void setType(io.github.mmm.code.api.type.CodeGenericType type)
      Specified by:
      setType in interface io.github.mmm.code.api.item.CodeMutableItemWithType
    • copy

      public BaseProperty copy()
      Specified by:
      copy in interface io.github.mmm.code.api.element.CodeElement
      Specified by:
      copy in interface io.github.mmm.code.api.element.CodeElementWithDeclaringType
      Specified by:
      copy in interface io.github.mmm.code.api.element.CodeElementWithModifiers
      Specified by:
      copy in interface io.github.mmm.code.api.element.CodeElementWithName
      Specified by:
      copy in interface io.github.mmm.code.api.member.CodeMember
      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.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeProperties, io.github.mmm.code.api.member.CodeProperty>
      Specified by:
      copy in interface io.github.mmm.code.api.member.CodeProperty
      Specified by:
      copy in class BaseMember
    • copy

      public BaseProperty 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.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeProperties, io.github.mmm.code.api.member.CodeProperty>
    • 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 BaseElement
      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)