net.sf.latexdraw.parsers.svg.parsers
Class URIReferenceParser

java.lang.Object
  extended by net.sf.latexdraw.parsers.CodeParser
      extended by net.sf.latexdraw.parsers.svg.parsers.AbstractSVGParser
          extended by net.sf.latexdraw.parsers.svg.parsers.URIReferenceParser
All Implemented Interfaces:
Parser

public class URIReferenceParser
extends AbstractSVGParser

Defines a parser that parses URI references.

This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

11/21/07

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  java.lang.String uri
          The parsed URI.
 
Fields inherited from class net.sf.latexdraw.parsers.CodeParser
codeCore, EOC
 
Constructor Summary
URIReferenceParser(java.lang.String code)
          Creates a parser.
 
Method Summary
 java.lang.String getUri()
           
 java.lang.String getURI()
          Reads a URI reference string from an url(#ref) attribute - such as url(#id123) - returns the extracted reference (id123).
 void parse()
          Launches the parsing.
 
Methods inherited from class net.sf.latexdraw.parsers.svg.parsers.AbstractSVGParser
isComment, isWSP, skipComment, skipWSP, skipWSPComma
 
Methods inherited from class net.sf.latexdraw.parsers.CodeParser
getChar, getCharAt, getCode, getCodeCore, getLinePosition, getPosition, incLinePosition, initialise, isEOC, isEOL, nextChar, setCode, setCodeCore, setLinePosition, setPosition, skipWSPComments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uri

protected java.lang.String uri
The parsed URI.

Constructor Detail

URIReferenceParser

public URIReferenceParser(java.lang.String code)
Creates a parser.

Parameters:
code - The code to parse.
Method Detail

getURI

public java.lang.String getURI()
Reads a URI reference string from an url(#ref) attribute - such as url(#id123) - returns the extracted reference (id123).

Returns:
The parsed reference or an empty string if the format of the code is not valid (not "url(#ref)")

parse

public void parse()
           throws java.text.ParseException
Description copied from interface: Parser
Launches the parsing.

Throws:
java.text.ParseException - If an error occurs.

getUri

public java.lang.String getUri()
Returns:
The parsed URI.
Since:
2.0.3