Interface LineNumberAware

All Known Subinterfaces:
NamedNode

public interface LineNumberAware
An entity that can point to a given line number from a source Resource such as YAML and XML DSL parsers.
Since:
3.15
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The line number of this entity.
    @Nullable String
    The location of the entity.
    void
    setLineNumber(int lineNumber)
    Sets the line number of this entity. parsing the source file and provide the line number representing this node.
    void
    setLocation(@Nullable String location)
    Sets the location of the entity (source file name, i.e. foo.java, bar.xml, etc.)
    static <T> T
    trySetLineNumberAware(T object, @Nullable LineNumberAware source)
    Set the LineNumberAware if the object is an instance of LineNumberAware.
  • Method Details

    • getLineNumber

      int getLineNumber()
      The line number of this entity.
      Returns:
      -1 if line number is not possible to know
    • setLineNumber

      void setLineNumber(int lineNumber)
      Sets the line number of this entity. parsing the source file and provide the line number representing this node.
      Parameters:
      lineNumber - the line number
    • getLocation

      @Nullable String getLocation()
      The location of the entity.
    • setLocation

      void setLocation(@Nullable String location)
      Sets the location of the entity (source file name, i.e. foo.java, bar.xml, etc.)
    • trySetLineNumberAware

      static <T> T trySetLineNumberAware(T object, @Nullable LineNumberAware source)
      Set the LineNumberAware if the object is an instance of LineNumberAware.