Package org.apache.tapestry5.internal.plastic

## Class InheritanceData

- java.lang.Object
- - org.apache.tapestry5.internal.plastic.InheritanceData

-     public class InheritanceData
      extends Object

  Used to track which methods are implemented by a base class, which is often needed when transforming a subclass.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `InheritanceData​(String packageName)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addInterface​(String name)` |
    `void` | `addMethod​(String name, String desc, boolean samePackageOnly)` | Adds a new instance method.
    `InheritanceData` | `createChild​(String packageName)` | Returns a new MethodBundle that represents the methods of a child class of this bundle.
    `boolean` | `isImplemented​(String name, String desc)` | Returns true if this class or a transformed parent class contains an implementation of, or abstract placeholder for, the method.
    `boolean` | `isInterfaceImplemented​(String name)` | Returns true if the class represented by this data, or any parent data, implements the named interface.
    `boolean` | `isOverride​(String name, String desc)` | Returns true if the method is an override of a base class method
    `boolean` | `isTransformed()` | Is this bundle for a transformed class, or for a base class (typically Object)?
    `Set<String>` | `methodNames()` | Returns the names of any methods in this bundle, or from any parent bundles.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InheritanceData

          public InheritanceData​(String packageName)

  - ### Method Detail

    - #### isTransformed

          public boolean isTransformed()

      Is this bundle for a transformed class, or for a base class (typically Object)?
      Returns:
        true if this bundle is for transformed class, false otherwise

    - #### createChild

          public InheritanceData createChild​(String packageName)

      Returns a new MethodBundle that represents the methods of a child class of this bundle. The returned bundle will always be transformed.
      Parameters:
        `packageName` - the package that the child class will be created in
      Returns:
        new method bundle

    - #### addMethod

          public void addMethod​(String name,
                                String desc,
                                boolean samePackageOnly)

      Adds a new instance method. Only non-private methods should be added (that is, methods which might be overridden in subclasses). This can later be queried to see if any base class implements the method.
      Parameters:
        `name` - name of method
        `desc` - describes the parameters and return value of the method
        `samePackageOnly` - whether the method can only be overridden in classes that are in the same package

    - #### isImplemented

          public boolean isImplemented​(String name,
                                       String desc)

      Returns true if this class or a transformed parent class contains an implementation of, or abstract placeholder for, the method.
      Parameters:
        `name` - method name
        `desc` - method descriptor
      Returns:
        true if this class or a base class implements the method (including abstract methods)

    - #### isOverride

          public boolean isOverride​(String name,
                                    String desc)

      Returns true if the method is an override of a base class method
      Parameters:
        `name` - method name
        `desc` - method descriptor
      Returns:
        true if a base class implements the method (including abstract methods)

    - #### isInterfaceImplemented

          public boolean isInterfaceImplemented​(String name)

      Returns true if the class represented by this data, or any parent data, implements the named interface.

    - #### addInterface

          public void addInterface​(String name)

    - #### methodNames

          public Set<String> methodNames()

      Returns the names of any methods in this bundle, or from any parent bundles.