Class Type

    • Method Detail

      • getKindName

        protected abstract java.lang.String getKindName()
      • getDeclaredAssociation

        public Association getDeclaredAssociation​(int index)
        Returns the association at the given index. Associations defined in the type's super types are not returned.
        Throws:
        java.lang.IndexOutOfBoundsException - if no association exists for the given index.
      • getDeclaredAttribute

        public Attribute getDeclaredAttribute​(int index)
        Returns the declared attribute at the given index.
        Throws:
        java.lang.IndexOutOfBoundsException - if no attribute exists for the given index.
      • getAssociation

        public Association getAssociation​(java.lang.String name)
        Returns the association with the given name declared in this type or one of it's super types. The name could either be the singular or the plural name.
        Throws:
        java.lang.IllegalArgumentException - if no association with the given name exists.
      • getAttribute

        public Attribute getAttribute​(java.lang.String name)
        Returns the attribute with the given name declared in this type or one of it's super types.
        Throws:
        java.lang.IllegalArgumentException - if no attribute with the given name exists.
      • getJavaClass

        public java.lang.Class<?> getJavaClass()
        Returns the Java class for this type.
      • getJavaInterface

        public java.lang.Class<?> getJavaInterface()
        Returns the published interface for this type. Returns null if published interfaces are not generated.
        See Also:
        findJavaInterface() for null-safe processing
      • findJavaInterface

        public java.util.Optional<java.lang.Class<?>> findJavaInterface()
        Returns the published interface for this type. if published interfaces are generated, otherwise an empty Optional.
      • getDeclarationClass

        public java.lang.Class<?> getDeclarationClass()
      • searchDeclaredMethod

        public <T extends java.lang.annotation.Annotation> java.lang.reflect.Method searchDeclaredMethod​(java.lang.Class<T> annotationClass,
                                                                                                         Type.AnnotatedElementMatcher<T> matcher)
        Searches for a method with the given annotation that matches the condition defined by a matcher. Only methods in this type's declaration class are considered, thus no methods from super classes are found.
        Parameters:
        annotationClass - the class of the annotation the method must be annotated with
        matcher - matcher to determine if the annotation has the correct properties
        Returns:
        the first method that is both annotated with the given annotation and has the correct annotated properties. null if no such method can be found.
        See Also:
        findDeclaredMethod for null-safe processing
      • findDeclaredMethod

        public <T extends java.lang.annotation.Annotation> java.util.Optional<java.lang.reflect.Method> findDeclaredMethod​(java.lang.Class<T> annotationClass,
                                                                                                                           Type.AnnotatedElementMatcher<T> matcher)
        Searches for a method with the given annotation that matches the condition defined by a matcher. Only methods in this type's declaration class are considered, thus no methods from super classes are found.
        Parameters:
        annotationClass - the class of the annotation the method must be annotated with
        matcher - matcher to determine if the annotation has the correct properties
        Returns:
        the first method that is both annotated with the given annotation and has the correct annotated properties. Optional.empty() if no such method can be found.
      • getDeclaredMethods

        protected java.util.List<java.lang.reflect.Method> getDeclaredMethods()
      • getDeclaredAssociations

        public abstract java.util.List<? extends Association> getDeclaredAssociations()
        Returns a list containing all associations declared in this type. Associations defined in the type's super types are not returned.
        Returns:
        the list of associations declared in this type
      • getAssociations

        public abstract java.util.List<? extends Association> getAssociations()
        Returns the type's associations including those defined in it's super types.
        Returns:
        the list of all associations declared in this type or in any super type
      • getDeclaredAssociation

        public abstract Association getDeclaredAssociation​(java.lang.String name)
        Returns the association with the given name declared in this type. Associations defined in the type's super types are not considered. The name could either be the singular or the plural name.
        Parameters:
        name - the name of the association
        Returns:
        the association if it was found in this type
        Throws:
        java.lang.IllegalArgumentException - if no association with the given name exists
        See Also:
        isAssociationDeclared(String)
      • isAssociationDeclared

        public abstract boolean isAssociationDeclared​(java.lang.String name)
        Returns whether the association with the given name is declared in this type. Associations defined in the type's super types are not considered.
        Parameters:
        name - the name of the association
        Returns:
        true if the association is declared in this type, false if not
        See Also:
        isAssociationPresent(String)
      • isAssociationPresent

        public boolean isAssociationPresent​(java.lang.String name)
        Returns whether the association with the given name is declared in this type or in any supertype.
        Parameters:
        name - the name of the association
        Returns:
        true if the association is declared in this type or in any supertype, false if not
        See Also:
        isAssociationDeclared(String)
      • getDeclaredAttributes

        public abstract java.util.List<? extends Attribute> getDeclaredAttributes()
        Returns a list containing all attributes declared in this model type. Attributes defined in the type's super types are not returned.
        Returns:
        the list of attributes declared in this type
      • isAttributeDeclared

        public abstract boolean isAttributeDeclared​(java.lang.String name)
        Returns whether the attribute with the given name is declared in this type. Attributes defined in the type's super types are not considered.
        Parameters:
        name - the name of the attribute
        Returns:
        true if the attribute is declared in this type, false if not
      • isAttributePresent

        public boolean isAttributePresent​(java.lang.String name)
        Returns whether the attribute with the given name is declared in this type or in any supertype.
        Parameters:
        name - the name of the attribute
        Returns:
        true if the attribute is declared in this type or in any supertype, false if not
      • getAttributes

        public abstract java.util.List<? extends Attribute> getAttributes()
        Returns a list containing the type's attributes including those defined in the type's super types.
        Returns:
        the list of all attributes declared in this type or in any supertype
      • getDeclaredAttribute

        public abstract Attribute getDeclaredAttribute​(java.lang.String name)
        Returns the attribute with the given name declared in this type. Attributes defined in the type's super types are not returned.
        Parameters:
        name - the name of the attribute
        Returns:
        the attribute if it was found in this type
        Throws:
        java.lang.IllegalArgumentException - if no attribute with the given name exists
        See Also:
        isAttributeDeclared(String)
      • isSuperTypePresent

        public boolean isSuperTypePresent()
        Returns whether this type has a super type.
        Returns:
        true if this type has a supertype, false if not
      • findSuperType

        public java.util.Optional<? extends Type> findSuperType()
        Returns this type's super type if present, otherwise an empty Optional.