congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Scanner
Code IndexAdd Tabnine to your IDE (free)

How to use
Scanner
in
org.apache.batik.css.parser

Best Java code snippets using org.apache.batik.css.parser.Scanner (Showing top 20 results out of 315)

origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Implements {@link ExtendedParser#parseStyleDeclaration(String)}.
 */
public void parseStyleDeclaration(String source)
  throws CSSException, IOException {
  scanner = new Scanner(source);
  parseStyleDeclarationInternal();
}
origin: org.apache.xmlgraphics/batik-css

/**
 * Advances to the next token, ignoring comments.
 */
protected int next() {
  try {
    for (;;) {
      scanner.clearBuffer();
      current = scanner.next();
      if (current == LexicalUnits.COMMENT) {
        documentHandler.comment(scanner.getStringValue());
      } else {
        break;
      }
    }
    return current;
  } catch (ParseException e) {
    reportError(e.getMessage());
    return current;
  }
}
origin: org.apache.xmlgraphics/batik-css

/**
 * Parses selectors using the current scanner.
 */
protected SelectorList parseSelectorsInternal()
  throws CSSException, IOException {
  nextIgnoreSpaces();
  SelectorList ret = parseSelectorList();
  scanner.close();
  scanner = null;
  return ret;
}
origin: org.apache.xmlgraphics/batik-css

/**
 * Returns the next token.
 */
public int next() throws ParseException {
  blankCharacters = 0;
  start = position - 1;
  nextToken();
  end = position - endGap();
  return type;
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Parses an unknown rule.
 */
protected void parseAtRule() {
  scanner.scanAtRule();
  documentHandler.ignorableAtRule(scanner.getStringValue());
  nextIgnoreSpaces();
}
origin: org.apache.xmlgraphics/batik-css

/**
 * Creates a parse exception.
 */
protected CSSParseException createCSSParseException(String key,
                          Object[] params) {
  return new CSSParseException(formatMessage(key, params),
                 documentURI,
                 scanner.getLine(),
                 scanner.getColumn());
}
origin: apache/batik

  return;
case '{':
  nextChar();
  type = LexicalUnits.LEFT_CURLY_BRACE;
  return;
case '}':
  nextChar();
  type = LexicalUnits.RIGHT_CURLY_BRACE;
  return;
case '=':
  nextChar();
  type = LexicalUnits.EQUAL;
  return;
case '+':
  nextChar();
  type = LexicalUnits.PLUS;
  return;
case ',':
  nextChar();
  type = LexicalUnits.COMMA;
  return;
case ';':
  nextChar();
  type = LexicalUnits.SEMI_COLON;
  return;
case '>':
  nextChar();
  type = LexicalUnits.PRECEDE;
  return;
origin: org.apache.xmlgraphics/batik-css

/**
 * Scans a number.
 */
protected int number() throws IOException {
  loop: for (;;) {
    switch (nextChar()) {
    case '.':
      switch (nextChar()) {
      case '0': case '1': case '2': case '3': case '4':
      case '5': case '6': case '7': case '8': case '9':
        return dotNumber();
      }
      throw new ParseException("character",
                   reader.getLine(),
                   reader.getColumn());
    default:
      break loop;
    case '0': case '1': case '2': case '3': case '4':
    case '5': case '6': case '7': case '8': case '9':
    }
  }
  return numberUnit(true);
}
origin: org.apache.xmlgraphics/batik-css

/**
 * Converts the current lexical unit to a float.
 */
protected float number(boolean positive) {
  try {
    float sgn = (positive) ? 1 : -1;
    String val = scanner.getStringValue();
    nextIgnoreSpaces();
    return sgn * Float.parseFloat(val);
  } catch (NumberFormatException e) {
    throw createCSSParseException("number.format");
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

  switch (nextChar()) {
  case -1:
    throw new ParseException("eof",
    break;
  case '\\':
    switch (nextChar()) {
    case '\n':
    case '\f':
      break;
    default:
      escape();
nextChar();
return LexicalUnits.STRING;
origin: org.apache.xmlgraphics/batik-css

documentHandler.startDocument(source);
current = scanner.next();
switch (current) {
case LexicalUnits.CHARSET_SYMBOL:
  documentHandler.comment(scanner.getStringValue());
scanner.close();
scanner = null;
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Skips the white spaces.
 */
protected int skipSpaces() {
  int lex = scanner.getType();
  while (lex == LexicalUnits.SPACE) {
    lex = next();
  }
  return lex;
}
origin: org.apache.xmlgraphics/batik-css

/**
 * Skips the white spaces and CDO/CDC units.
 */
protected int skipSpacesAndCDOCDC() {
  loop: for (;;) {
    switch (current) {
    default:
      break loop;
    case LexicalUnits.COMMENT:
    case LexicalUnits.SPACE:
    case LexicalUnits.CDO:
    case LexicalUnits.CDC:
    }
    scanner.clearBuffer();
    next();
  }
  return current;
}
origin: org.apache.xmlgraphics/batik-css

  return;
case '{':
  nextChar();
  type = LexicalUnits.LEFT_CURLY_BRACE;
  return;
case '}':
  nextChar();
  type = LexicalUnits.RIGHT_CURLY_BRACE;
  return;
case '=':
  nextChar();
  type = LexicalUnits.EQUAL;
  return;
case '+':
  nextChar();
  type = LexicalUnits.PLUS;
  return;
case ',':
  nextChar();
  type = LexicalUnits.COMMA;
  return;
case ';':
  nextChar();
  type = LexicalUnits.SEMI_COLON;
  return;
case '>':
  nextChar();
  type = LexicalUnits.PRECEDE;
  return;
origin: apache/batik

/**
 * Scans a number.
 */
protected int number() throws IOException {
  loop: for (;;) {
    switch (nextChar()) {
    case '.':
      switch (nextChar()) {
      case '0': case '1': case '2': case '3': case '4':
      case '5': case '6': case '7': case '8': case '9':
        return dotNumber();
      }
      throw new ParseException("character",
                   reader.getLine(),
                   reader.getColumn());
    default:
      break loop;
    case '0': case '1': case '2': case '3': case '4':
    case '5': case '6': case '7': case '8': case '9':
    }
  }
  return numberUnit(true);
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Converts the current lexical unit to a float.
 */
protected float number(boolean positive) {
  try {
    float sgn = (positive) ? 1 : -1;
    String val = scanner.getStringValue();
    nextIgnoreSpaces();
    return sgn * Float.parseFloat(val);
  } catch (NumberFormatException e) {
    throw createCSSParseException("number.format");
  }
}
origin: apache/batik

  switch (nextChar()) {
  case -1:
    throw new ParseException("eof",
    break;
  case '\\':
    switch (nextChar()) {
    case '\n':
    case '\f':
      break;
    default:
      escape();
nextChar();
return LexicalUnits.STRING;
origin: fr.avianey.apache-xmlgraphics/batik

documentHandler.startDocument(source);
current = scanner.next();
switch (current) {
case LexicalUnits.CHARSET_SYMBOL:
  documentHandler.comment(scanner.getStringValue());
scanner.close();
scanner = null;
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns the next token.
 */
public int next() throws ParseException {
  blankCharacters = 0;
  start = position - 1;
  nextToken();
  end = position - endGap();
  return type;
}
origin: org.apache.xmlgraphics/batik-css

/**
 * Parses an unknown rule.
 */
protected void parseAtRule() {
  scanner.scanAtRule();
  documentHandler.ignorableAtRule(scanner.getStringValue());
  nextIgnoreSpaces();
}
org.apache.batik.css.parserScanner

Javadoc

This class represents a CSS scanner - an object which decodes CSS lexical units.

Most used methods

  • <init>
    Creates a new Scanner object.
  • clearBuffer
    Clears the buffer.
  • close
    Closes the underlying stream used by the scanner.
  • dotNumber
    Scans the decimal part of a number.
  • endGap
    Returns the end gap of the current lexical unit.
  • escape
    Scans an escape sequence, if one.
  • getColumn
    Returns the current column.
  • getLine
    Returns the current line.
  • getStringValue
    Returns the string representation of the current lexical unit.
  • getType
    The current lexical unit type like defined in LexicalUnits.
  • isEqualIgnoreCase
    Compares the given int with the given character, ignoring case.
  • next
    Returns the next token.
  • isEqualIgnoreCase,
  • next,
  • nextChar,
  • nextToken,
  • number,
  • numberUnit,
  • scanAtRule,
  • string1,
  • string2

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now