Interface IStringLiteralTypeComputer

    • Method Detail

      • computeTypes

        Collection<LiteralType> computeTypes​(StringLiteral literal)
        Computes the string literal content types.
        Parameters:
        literal - the string literal to compute it's types, cannot be null.
        Returns:
        the collection of computed or annotated string literal content types, cannot return null.
      • containsAnyType

        boolean containsAnyType​(StringLiteral literal,
                                String... typeNames)
        Checks that string literal content types contains any of given type.
        Parameters:
        literal - the string literal, can be null.
        typeNames - the StringLiteral content type names, can be null.
        Returns:
        true, if any of given types contains in the string literal content types
      • containsAnyType

        boolean containsAnyType​(Collection<LiteralType> types,
                                String... typeNames)
        Checks that collection of content types contains any of given type.
        Parameters:
        types - the collection of string literal content types, can be null.
        typeNames - the StringLiteral content type names, can be null.
        Returns:
        true, if any of given types contains in the string literal content types
      • getAnnotatedTypes

        Collection<LiteralType> getAnnotatedTypes​(StringLiteral literal)
        Gets the only annotated types of string literal content types.
        Parameters:
        literal - the literal to collect annotating types, cannot be null.
        Returns:
        the annotated types of string literal content types, cannot return null.
      • getAnnotationNodes

        Map<LiteralType,​org.eclipse.xtext.nodemodel.INode> getAnnotationNodes​(StringLiteral literal)
        Gets the nodes which contains annotation of the content type for the string literal.
        Parameters:
        literal - the literal to get it's content type annotation nodes, cannot be null.
        Returns:
        the annotation nodes, cannot return null.
      • indexOnLastLine

        int indexOnLastLine​(StringLiteral literal)
        Get the index of string literal on last line of string literal lines. If the string literal has multi-line content then it's index is 0 as first literal.
        Parameters:
        literal - the string literal to get the index, cannot be null.
        Returns:
        the index on the last line of literal lines, first index is 0. If return -1 this means cannot determine position of the literal in the line of code, might be some error or string literal is not part of Xtext code.
      • allTypes

        Collection<LiteralType> allTypes()
        Provider all registered types. Caller cannot modify this collection and should contribute string literal type description in extension point.
        Returns:
        the collection of types, cannot return null.
      • getTypeDescription

        String getTypeDescription​(LiteralType type)
        Gets the localizable description of StringLiteral content type.
        Parameters:
        type - the string literal type description, cannot be null.
        Returns:
        the type localizable description, can return null.
      • getTypeDescription

        String getTypeDescription​(String typeName)
        Gets the localizable description of StringLiteral content type.
        Parameters:
        typeName - the StringLiteral content type name, can be null.
        Returns:
        the type localizable description, can return null.
      • getValidators

        Map<LiteralType,​Collection<TypeValidator>> getValidators()
        Gets the validators of string literal content types.
        Returns:
        the validators allow to check content of string literal that it valid for annotated type, cannot return null.