Java Code Examples for com.gargoylesoftware.css.parser.CSSParseException#getColumnNumber()

The following examples show how to use com.gargoylesoftware.css.parser.CSSParseException#getColumnNumber() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultCssErrorHandler.java    From htmlunit with Apache License 2.0 5 votes vote down vote up
/**
 * Builds a message for the specified CSS parsing exception.
 * @param exception the CSS parsing exception to build a message for
 * @return a message for the specified CSS parsing exception
 */
private static String buildMessage(final CSSParseException exception) {
    final String uri = exception.getURI();
    final int line = exception.getLineNumber();
    final int col = exception.getColumnNumber();

    if (null == uri) {
        return "[" + line + ":" + col + "] " + exception.getMessage();
    }
    return "'" + uri + "' [" + line + ":" + col + "] " + exception.getMessage();
}
 
Example 2
Source File: DefaultCssErrorHandler.java    From HtmlUnit-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Builds a message for the specified CSS parsing exception.
 * @param exception the CSS parsing exception to build a message for
 * @return a message for the specified CSS parsing exception
 */
private static String buildMessage(final CSSParseException exception) {
    final String uri = exception.getURI();
    final int line = exception.getLineNumber();
    final int col = exception.getColumnNumber();

    if (null == uri) {
        return "[" + line + ":" + col + "] " + exception.getMessage();
    }
    return "'" + uri + "' [" + line + ":" + col + "] " + exception.getMessage();
}