Interface DeclaredStatement<A>

    • Method Detail

      • rawArgument

        @Nullable String rawArgument()
        Returns statement argument as was present in original source.
        Returns:
        statement argument as was present in original source or null, if statement does not take argument.
      • declaredSubstatements

        @NonNull Collection<? extends DeclaredStatement<?>> declaredSubstatements()
        Returns collection of explicitly declared child statements, while preserving its original ordering from original source.
        Returns:
        Collection of statements, which were explicitly declared in source of model.
      • declaredSubstatements

        default <T extends DeclaredStatement<?>> @NonNull Collection<? extends T> declaredSubstatements​(Class<T> type)
        Returns collection of explicitly declared child statements, while preserving its original ordering from original source.
        Type Parameters:
        T - substatement type
        Parameters:
        type - DeclaredStatement type
        Returns:
        Collection of statements, which were explicitly declared in source of model.
        Throws:
        NullPointerException - if type is null
      • declarationReference

        @Beta
        default @NonNull Optional<DeclarationReference> declarationReference()
        Returns a DeclarationReference associated with this statement, if available.
        Returns:
        A DeclarationReference associated with this statement or Optional.empty().
        API Note:
        This method does not contribute any semantic information and is provided purely as a conduit for implementation-specific information where a statement instance came from.
        Implementation Requirements:
        The default implementation returns Optional.empty().
      • findFirstDeclaredSubstatement

        @Beta
        default <T extends DeclaredStatement<?>> @NonNull Optional<T> findFirstDeclaredSubstatement​(@NonNull Class<T> type)
        Find the first effective substatement of specified type.
        Type Parameters:
        T - substatement type
        Parameters:
        type - DeclaredStatement type
        Returns:
        First declared substatement, or empty if no match is found.
        Throws:
        NullPointerException - if type is null
      • findFirstDeclaredSubstatementArgument

        @Beta
        default <V,​T extends DeclaredStatement<V>> @NonNull Optional<V> findFirstDeclaredSubstatementArgument​(@NonNull Class<T> type)
        Find the first declared substatement of specified type and return its value.
        Type Parameters:
        T - substatement type
        V - substatement argument type
        Parameters:
        type - DeclaredStatement type
        Returns:
        First declared substatement's argument, or empty if no match is found.
        Throws:
        NullPointerException - if type is null
      • streamDeclaredSubstatements

        @Beta
        default <T extends DeclaredStatement<?>> @NonNull Stream<T> streamDeclaredSubstatements​(@NonNull Class<T> type)
        Find all declared substatements of specified type and return them as a stream.
        Type Parameters:
        T - substatement type
        Parameters:
        type - DeclaredStatement type
        Returns:
        A stream of all declared substatements of specified type.
        Throws:
        NullPointerException - if type is null