Examples of Parser


Examples of org.objectstyle.woenvironment.util.Parser

    Enumeration<FileSet> e;
    /**
     * Get Dictionary from pbproj
     */
    try {
      dico = (Map) new Parser(new File(new Path(this.getProject(), getPbxproj()).toString())).propertyList();
    } catch (Exception ex) {
      ex.printStackTrace(System.err);
    }
    /**
     * TODO: Handle Better Warnings
View Full Code Here

Examples of org.ofbiz.sql.Parser

    public SQLTest(String name) {
        super(name);
    }

    private static Parser parser(SQLStatement<?> s) throws Exception {
        return new Parser(new StringReader(s.toString()));
    }
View Full Code Here

Examples of org.openrdf.rio.Parser

    public void addData(InputStream dataStream, String baseURI, RDFFormat format, boolean verifyData, AdminListener listener) throws IOException, AccessDeniedException
    {
  try
  {
      Parser parser = null;
      Map noParams = new HashMap();
      if(format.equals(RDFFormat.TURTLE))
      {
    parser = new TurtleParser();
    }
      else if(format.equals(RDFFormat.RDFXML))
    {
    parser = new RdfXmlParser();
    }
      else if(format.equals(RDFFormat.NTRIPLES))
      {
    parser = new NTriplesParser();
      }
      else return;

      parser.setDatatypeHandling(Parser.DT_IGNORE); // TODO find out what this is doing
      StatementHandler sh = new StatementHandler()
      {
    public void handleStatement(Resource subj, URI pred, Value obj)
    {
        addSingleStatement(subj, pred, obj);
  }
      };
      parser.setStatementHandler(sh);
      parser.parse(dataStream, baseURI);
      dataStream.close();
  }
  catch (Exception e)
  {
      System.out.println(e.getMessage());
View Full Code Here

Examples of org.opensocial.parsers.Parser

  }

  static Map<String, Response> parseRpcResponse(
      Map<String, Request> requests, HttpResponseMessage responseMessage,
      String version) {
    Parser parser = getParser(responseMessage.getResponse());

    Map<String, Class<? extends Model>> modelClasses =
        new HashMap<String, Class<? extends Model>>();
    for (Map.Entry<String, Request> requestEntry : requests.entrySet()) {
      Request request = requestEntry.getValue();
      modelClasses.put(requestEntry.getKey(), request.getModelClass());
    }

    return parser.getResponseMap(responseMessage.getResponse(), modelClasses,
        version);
  }
View Full Code Here

Examples of org.opentripplanner.routing.impl.LongDistancePathService.Parser

public class LongDistancePathServiceTest {
    @Test
    public final void testTerminalFor() {
        // Create a long distance path parser
        Parser parser = new Parser();

        State emptyState = mock(State.class);

        State streetState = mock(State.class);
        when(streetState.getBackEdge()).thenReturn(mock(StreetEdge.class));

        State linkState = mock(State.class);
        when(linkState.getBackEdge()).thenReturn(mock(StreetTransitLink.class));

        State stationState = mock(State.class);
        when(stationState.getBackEdge()).thenReturn(mock(PreAlightEdge.class));

        State onboardState = mock(State.class);
        when(onboardState.getBackEdge()).thenReturn(mock(PatternHop.class));

        State transferState = mock(State.class);
        when(transferState.getBackEdge()).thenReturn(mock(TransferEdge.class));

        State stationStopState = mock(State.class);
        when(stationStopState.getBackEdge()).thenReturn(mock(StationStopEdge.class));
        when(stationStopState.getVertex()).thenReturn(mock(TransitStop.class));

        State stopStationState = mock(State.class);
        when(stopStationState.getBackEdge()).thenReturn(mock(StationStopEdge.class));
        when(stopStationState.getVertex()).thenReturn(mock(TransitStation.class));

        try {
            parser.terminalFor(emptyState);
            fail();
        } catch (Throwable throwable) {
            assertEquals(RuntimeException.class, throwable.getClass()); // A back edge must be given
        }

        assertEquals(Parser.STREET, parser.terminalFor(streetState));
        assertEquals(Parser.LINK, parser.terminalFor(linkState));
        assertEquals(Parser.STATION, parser.terminalFor(stationState));
        assertEquals(Parser.ONBOARD, parser.terminalFor(onboardState));
        assertEquals(Parser.TRANSFER, parser.terminalFor(transferState));
        assertEquals(Parser.STATION_STOP, parser.terminalFor(stationStopState));
        assertEquals(Parser.STOP_STATION, parser.terminalFor(stopStationState));
    }
View Full Code Here

Examples of org.openxml.io.Parser

    /**
      Creates a NodeList from the root element of the XML Stream.
    */
    public NodeList createDOM()
    {
        Parser parser = null;
        Document doc = null;

        try
        {
            outStream.close(); // before we parse the InputStream make sure the pipe is closed.
            parser = org.openxml.DOMFactory.createParser( pis, null, org.openxml.DOMFactory.DOCUMENT_XML );
            doc = parser.parseDocument();
        }
        catch(java.io.IOException ioe)
        {
            System.err.println(ioe.toString());
            ioe.printStackTrace();
View Full Code Here

Examples of org.openxri.xri3.impl.parser.Parser

public class PrintTest {

  public static void main(String[] args) {
   
    Parser parser = new Parser();
    Rule rule = parser.parse("xri", "@cordance/documentation/xri?page=overview#introduction");
    new TreeDisplayer(System.out).visit(rule);
  }
View Full Code Here

Examples of org.ops4j.pax.url.mvn.Parser

        if (locationMap.containsKey(location)) {
            return;
        }
        try {
            String noPrefixLocation = location.toString().substring(location.toString().lastIndexOf(":") + 1);
            Parser parser = new Parser(noPrefixLocation);
            InputStream is = location.toURL().openStream();
            String path = "repository/" + parser.getArtifactPath();
            jos.putNextEntry(new JarEntry(path));
            Kar.copyStream(is, jos);
            is.close();
            locationMap.put(location, 1);
        } catch (Exception e) {
View Full Code Here

Examples of org.ops4j.pax.url.mvn.internal.Parser

     * @param bundle
     * @return
     */
    public File getBundleExternalLocation(File localRepository, Bundle bundle) {
        try {
            Parser p = new Parser(bundle.getLocation().substring(4));
            return new File(localRepository.getPath() + File.separator + p.getArtifactPath());
        } catch (MalformedURLException e) {
            logger.error("Could not parse artifact path for bundle" + bundle.getSymbolicName(), e);
        }
        return null;
    }
View Full Code Here

Examples of org.osgilab.tips.jaxb.parser.Parser

*/
public class BusinessLogic {
    private Parser parser;

    public BusinessLogic() {
        parser = new Parser();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.