Tabnine Logo
Token.setType
Code IndexAdd Tabnine to your IDE (free)

How to use
setType
method
in
de.pdark.decentxml.Token

Best Java code snippets using de.pdark.decentxml.Token.setType (Showing top 18 results out of 315)

origin: de.pdark/decentxml

/** Parse a doctype declaration
*
*  <p>The resulting token will contain "<!DOCTYPE"
*/
protected void parseDocType (Token token)
{
  token.setType (Type.DOCTYPE);
  nextChars ("<!DOCTYPE", pos - 3, "Expected '<!DOCTYPE'");
}
origin: de.pdark/decentxml

protected void parseDocTypeText (Token token)
{
  token.setType (Type.TEXT);
  pos --;
  while (pos < source.length () && getCharValidator ().isNameChar (source.charAt (pos)))
    pos ++;
  
  String s = source.substring (token.getStartOffset (), pos);
  if (s.length () == 0)
    throw new XMLParseException ("Expected some text"+lookAheadForErrorMessage ("but found", token.getStartOffset (), 20), token);
  
  // TODO How about "<!DOCTYPE SYSTEM ..."?
  if ("SYSTEM".equals (s))
    token.setType (Type.DOCTYPE_SYSTEM);
  else if ("PUBLIC".equals (s))
    token.setType (Type.DOCTYPE_PUBLIC);
  else if ("NDATA".equals (s))
    token.setType (Type.DOCTYPE_NDATA);
}
origin: de.pdark/decentxml

token.setType (Type.DOCTYPE_BEGIN_SUBSET);
docTypeLevel ++;
break;
token.setType (Type.DOCTYPE_END_SUBSET);
docTypeLevel --;
break;
token.setType (Type.DOCTYPE_BEGIN_GROUP);
docTypeLevel ++;
break;
token.setType (Type.DOCTYPE_END_GROUP);
docTypeLevel --;
break;
token.setType (Type.DOCTYPE_ZERO_OR_ONE);
break;
token.setType (Type.DOCTYPE_ZERO_OR_MORE);
break;
token.setType (Type.DOCTYPE_ONE_OR_MORE);
break;
token.setType (Type.DOCTYPE_ALTERNATIVE);
break;
token.setType (Type.DOCTYPE_SEQUENCE);
origin: de.pdark/decentxml

case 'I':
  expected = "#IMPLIED";
  token.setType (Type.DOCTYPE_IMPLIED);
  break;
case 'P':
  expected = "#PCDATA";
  token.setType (Type.DOCTYPE_PCDATA);
  break;
case 'R':
  expected = "#REQUIRED";
  token.setType (Type.DOCTYPE_REQUIRED);
  break;
case 'F':
  expected = "#FIXED";
  token.setType (Type.DOCTYPE_FIXED);
  break;
origin: de.pdark/decentxml

  token.setType (Type.DOCTYPE_ELEMENT);
  token.setType (Type.DOCTYPE_ENTITY);
token.setType (Type.DOCTYPE_ATTLIST);
token.setType (Type.DOCTYPE_NOTATION);
token.setType (Type.DOCTYPE);
origin: de.pdark/decentxml

/**
 * Read an end tag.
 * 
 * <p>The resulting token will contain the '&lt;/' and '&gt;' plus the
 * name plus any whitespace between those three.
 */
protected void parseEndElement (Token token)
{
  token.setType (Type.END_ELEMENT);
  
  skipWhiteSpace ();
  
  parseName ("end tag");
  
  skipWhiteSpace ();
  
  expect ('>');
}
origin: de.pdark/decentxml

protected void parseDocTypeComment (Token token)
{
  expect ('-');
  
  while (pos < source.length ())
  {
    char c = source.charAt (pos);
    if (c == '-')
    {
      c = nextChar ("Expected '--'");
      if (c == '-')
      {
        pos ++;
        break;
      }
    }
    pos ++;
  }
  
  token.setType (Type.DOCTYPE_COMMENT);
}
origin: de.pdark/decentxml

protected void parseEntity (Token token)
{
  token.setType (Type.ENTITY);
  
  char c;
  if (pos < source.length ())
  {
    c = source.charAt (pos);
    if (c == '#')
      pos ++;
  }
  
  while (pos < source.length ())
  {
    c = source.charAt (pos);
    if (c == ';')
      break;
    
    if (!charValidator.isNameChar (c))
      throw new XMLParseException ("Illegal character in entity: ["+c+"] ("+Integer.toHexString (c)+")", source, pos);
    
    pos ++;
  }
  
  expect (';');
  
  verifyEntity (token.getStartOffset (), pos);
}
origin: de.pdark/decentxml

/** Read the name of an element.
 * 
 *  <p>The resulting token will contain the '&lt;' plus any whitespace between
 *  it and the name plus the name itself but no whitespace after the name.
 */
protected void parseBeginElement (Token token)
{
  token.setType (Type.BEGIN_ELEMENT);
  inStartElement = true;
  
  skipWhiteSpace ();
  
  int nameStartOffset = pos;
  
  parseName ("start tag");
  
  if (pos == nameStartOffset)
    throw new XMLParseException ("Missing element name", token);
  
  if (pos >= source.length ())
    throw new XMLParseException ("Missing '>' of start tag", source, pos);
  
  char c = source.charAt (pos);
  if (!charValidator.isWhitespace (c) && c != '/' && c != '>')
    throw new XMLParseException ("Expected whitespace, '>' or '/>' after element name", source, pos);
}
origin: de.pdark/decentxml

token.setType (Type.BEGIN_ELEMENT_END);
inStartElement = false;
token.setType (Type.BEGIN_ELEMENT_END);
inStartElement = false;
origin: de.pdark/decentxml

token.setType (Type.PROCESSING_INSTRUCTION);
int errorPos = pos - 2;
origin: de.pdark/decentxml

token.setType (Type.CDATA);
origin: de.pdark/decentxml

token.setType (Type.TEXT);
int errorPos = pos - 1;
boolean insideEntity = false;
origin: de.pdark/decentxml

protected void parseDocTypeQuotedText (Token token)
  token.setType (Type.DOCTYPE_QUOTED_TEXT);
  int errorPos = pos - 1;
  char quoteChar = source.charAt (errorPos);
origin: de.pdark/decentxml

token.setType (Type.COMMENT);
origin: io.fabric8.forge/camel-tooling-util

token.setType(Type.ATTRIBUTE);
origin: de.pdark/decentxml

token.setType (Type.ATTRIBUTE);
origin: jboss-fuse/fabric8

token.setType(Type.ATTRIBUTE);
de.pdark.decentxmlTokensetType

Popular methods of Token

  • getStartOffset
    The position in the source at which the token begins
  • getText
    Return the string of text which this token represents in the XMLSource
  • <init>
  • getEndOffset
    The position after the last character of the token (matching the definition of String.substring(star
  • getEscapedText
    Return the text with all special characters (like line feed, new line, null bytes, characters in the
  • getPrefixWhiteSpace
  • getSource
  • getType
  • setEndOffset
  • setSource
  • setStartOffset
  • setStartOffset

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • ImageIO (javax.imageio)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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