Package com.helger.css
Class CSSSourceLocation
- java.lang.Object
-
- com.helger.css.CSSSourceLocation
-
@Immutable public class CSSSourceLocation extends Object
Defines the source location of an object when reading CSS from a stream. It consists of the position of the start token and the position of the end token.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description CSSSourceLocation(CSSSourceArea aFirstTokenArea, CSSSourceArea aLastTokenArea)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
CSSSourceArea
getFirstTokenArea()
int
getFirstTokenBeginColumnNumber()
int
getFirstTokenBeginLineNumber()
int
getFirstTokenEndColumnNumber()
int
getFirstTokenEndLineNumber()
String
getFirstTokenLocationAsString()
CSSSourceArea
getLastTokenArea()
int
getLastTokenBeginColumnNumber()
int
getLastTokenBeginLineNumber()
int
getLastTokenEndColumnNumber()
int
getLastTokenEndLineNumber()
String
getLastTokenLocationAsString()
String
getLocationAsString()
boolean
hasFirstTokenArea()
int
hashCode()
boolean
hasLastTokenArea()
String
toString()
-
-
-
Constructor Detail
-
CSSSourceLocation
public CSSSourceLocation(@Nullable CSSSourceArea aFirstTokenArea, @Nullable CSSSourceArea aLastTokenArea)
Constructor.- Parameters:
aFirstTokenArea
- Area of the first token. May benull
if the last token area is notnull
.aLastTokenArea
- Area of the last token. May benull
if the first token area is notnull
.- Throws:
IllegalArgumentException
- if both areas arenull
.
-
-
Method Detail
-
getFirstTokenArea
@Nullable public CSSSourceArea getFirstTokenArea()
- Returns:
- The area of the first token. May be
null
if no such information is available.
-
hasFirstTokenArea
public boolean hasFirstTokenArea()
- Returns:
true
if the first token area is present
-
getFirstTokenBeginLineNumber
@CheckForSigned public int getFirstTokenBeginLineNumber()
- Returns:
- The line number where the first token begins (incl.). May be -1 if not such token is available.
-
getFirstTokenBeginColumnNumber
@CheckForSigned public int getFirstTokenBeginColumnNumber()
- Returns:
- The column number where the first token begins (incl.). May be -1 if not such token is available.
-
getFirstTokenEndLineNumber
@CheckForSigned public int getFirstTokenEndLineNumber()
- Returns:
- The line number where the fist token ends (incl.). May be -1 if not such token is available.
-
getFirstTokenEndColumnNumber
@CheckForSigned public int getFirstTokenEndColumnNumber()
- Returns:
- The column number where the first token ends (incl.). May be -1 if not such token is available.
-
getLastTokenArea
@Nullable public CSSSourceArea getLastTokenArea()
- Returns:
- The area of the last token. May be
null
if no such information is available.
-
hasLastTokenArea
public boolean hasLastTokenArea()
- Returns:
true
if the last token area is present
-
getLastTokenBeginLineNumber
@CheckForSigned public int getLastTokenBeginLineNumber()
- Returns:
- The line number where the last token begins (incl.). May be -1 if not such token is available.
-
getLastTokenBeginColumnNumber
@CheckForSigned public int getLastTokenBeginColumnNumber()
- Returns:
- The column number where the last token begins (incl.). May be -1 if not such token is available.
-
getLastTokenEndLineNumber
@CheckForSigned public int getLastTokenEndLineNumber()
- Returns:
- The line number where the fist token ends (incl.). May be -1 if not such token is available.
-
getLastTokenEndColumnNumber
@CheckForSigned public int getLastTokenEndColumnNumber()
- Returns:
- The column number where the last token ends (incl.). May be -1 if not such token is available.
-
getFirstTokenLocationAsString
@Nullable public String getFirstTokenLocationAsString()
- Returns:
- The location of the first token as a simple string. May be
null
.
-
getLastTokenLocationAsString
@Nullable public String getLastTokenLocationAsString()
- Returns:
- The location of the last token as a simple string. May be
null
.
-
-