Class JavaElementBase<E extends Element,​T extends TypeMirror>

    • Field Detail

      • element

        protected final E extends Element element
      • representation

        protected final T extends TypeMirror representation
    • Method Detail

      • getHumanReadableElementType

        @Nonnull
        protected abstract String getHumanReadableElementType()
      • getParent

        @Nullable
        public org.revapi.java.spi.JavaModelElement getParent()
        Specified by:
        getParent in interface org.revapi.Element<E extends Element>
        Specified by:
        getParent in interface org.revapi.java.spi.JavaModelElement
        Overrides:
        getParent in class org.revapi.base.BaseElement<org.revapi.java.spi.JavaElement>
      • setParent

        public void setParent​(@Nullable
                              org.revapi.java.spi.JavaElement parent)
        Specified by:
        setParent in interface org.revapi.Element<E extends Element>
        Overrides:
        setParent in class org.revapi.base.BaseElement<org.revapi.java.spi.JavaElement>
      • getApi

        @Nonnull
        public org.revapi.API getApi()
        Specified by:
        getApi in interface org.revapi.Element<E extends Element>
        Overrides:
        getApi in class org.revapi.base.BaseElement<org.revapi.java.spi.JavaElement>
      • getDeclaringElement

        public E getDeclaringElement()
        Specified by:
        getDeclaringElement in interface org.revapi.java.spi.JavaModelElement
      • getModelRepresentation

        public T getModelRepresentation()
        Specified by:
        getModelRepresentation in interface org.revapi.java.spi.JavaModelElement
      • isInherited

        public boolean isInherited()
        Specified by:
        isInherited in interface org.revapi.java.spi.JavaModelElement
      • setInherited

        public void setInherited​(boolean inherited)
      • getFullHumanReadableString

        @Nonnull
        public final String getFullHumanReadableString()
        Specified by:
        getFullHumanReadableString in interface org.revapi.Element<E extends Element>
        Overrides:
        getFullHumanReadableString in class org.revapi.base.BaseElement<org.revapi.java.spi.JavaElement>
      • createFullHumanReadableString

        protected String createFullHumanReadableString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • clone

        public JavaElementBase<E,​T> clone()
        Overrides:
        clone in class org.revapi.base.BaseElement<org.revapi.java.spi.JavaElement>
      • cloneUnder

        public Optional<JavaElementBase<E,​T>> cloneUnder​(JavaElementBase<?,​?> newParent)
        Clones this element and tries to add it under the new parent. If the parent already contains an element equivalent to this one, the returned optional is empty, otherwise it contains the clone.
        Parameters:
        newParent - the parent to add the clone to
        Returns:
        optional with the clone or an empty optional if the new parent already contains an equivalent element
      • getComparableSignature

        protected String getComparableSignature()
      • createComparableSignature

        protected abstract String createComparableSignature()