Class UMLNode

java.lang.Object
nl.talsmasoftware.umldoclet.uml.UMLNode
Direct Known Subclasses:
Diagram, Link, Namespace, Parameters, Parameters.Parameter, Reference, Type, TypeMember

public abstract class UMLNode extends Object
Part of an UML diagram that can render itself to the diagram by writing to an indenting writer. It serves as a reusable base-class for all specific UML nodes.

UML nodes are capable of rendering themselves to IndentingPrintWriter.

Author:
Sjoerd Talsma
  • Constructor Details

    • UMLNode

      protected UMLNode(UMLNode parent)
  • Method Details

    • getParent

      public UMLNode getParent()
    • setParent

      public void setParent(UMLNode parent)
    • findParent

      protected <U extends UMLNode> Optional<U> findParent(Class<U> nodeType)
    • getChildren

      public List<UMLNode> getChildren()
    • getChildren

      public <T extends UMLNode> List<T> getChildren(Class<T> type)
      Returns all children that are an instance of a particular type.
      Type Parameters:
      T - The type of children to obtain.
      Parameters:
      type - The type of UMLNode to return (required, non-null).
      Returns:
      The filtered list of children of this uml node (unmodifiable).
    • addChild

      public void addChild(UMLNode child)
    • removeChildren

      public void removeChildren(Predicate<? super UMLNode> condition)
    • getConfiguration

      protected Configuration getConfiguration()
    • writeTo

      protected abstract <IPW extends IndentingPrintWriter> IPW writeTo(IPW output)
      Renders this object to the given indenting output.
      Type Parameters:
      IPW - The subclass of indenting print writer being written to.
      Parameters:
      output - The output to render this object to.
      Returns:
      A reference to the output for method chaining purposes.
    • writeChildrenTo

      protected <IPW extends IndentingPrintWriter> IPW writeChildrenTo(IPW output)
      Helper method to write all children to the specified output.
      Type Parameters:
      IPW - The subclass of indenting print writer being written to.
      Parameters:
      output - The output to write the children to.
      Returns:
      A reference to the output for method chaining purposes.
    • toString

      public String toString()
      Renders the entire content of this renderer and returns it as a String value.
      Overrides:
      toString in class Object
      Returns:
      The rendered content of this renderer.