public void merge(String s) { merge(XMLParser.parse(s)); }
case TEXT: return createText (token); case ENTITY: return createEntity (token); case ATTRIBUTE: return createAttribute (token); case BEGIN_ELEMENT: return createElement (token); case CDATA: return createCData (token); case COMMENT: return createComment (token); case DTD_WHITESPACE: return createElementWhitespace (token); case PROCESSING_INSTRUCTION: return createProcessingInstruction (token); case DOCTYPE_END: case DOCTYPE_SYSTEM: case DOCTYPE_PARAMETER_ENTITY: case DOCTYPE_PARAMETER_ENTITY_END: return createDocTypeText (token);
public void merge(File f) throws IOException { merge(XMLParser.parse(f)); }
public static ProductConfiguration read( InputStream input ) throws IOException { try { return new ProductConfiguration( parser.parse( new XMLIOSource( input ) ) ); } finally { IOUtil.close( input ); } }
/** Convenience method to parse a String into XML. * * <p>In this case, the encoding is ignored; the string already has to * be Unicode. After the parsing, you will still find the encoding from * the XML declaration in the Document (if there was one). */ public static Document parse (String xml) { return new XMLParser ().parse (new XMLStringSource (xml)); }
public static Category read( InputStream is ) throws IOException { try { return new Category( parser.parse( new XMLIOSource( is ) ) ); } finally { IOUtil.close( is ); } }
public static UpdateSite read( InputStream is ) throws IOException { try { return new UpdateSite( parser.parse( new XMLIOSource( is ) ) ); } finally { IOUtil.close( is ); } }
public static Target read( File file ) throws IOException { FileInputStream input = new FileInputStream( file ); try { return new Target( parser.parse( new XMLIOSource( input ) ) ); } finally { IOUtil.close( input ); } }
public static UpdateSite read(InputStream is) throws IOException { try { return new UpdateSite(parser.parse(new XMLIOSource(is))); } finally { IOUtil.close(is); } }
public static IU read(File file) throws IOException { FileInputStream is = new FileInputStream(file); try { Document iuDocument = parser.parse(new XMLIOSource(is)); Element root = iuDocument.getChild(UNIT); if (root == null) throw new RuntimeException("No iu found."); IU result = new IU(iuDocument, root); if (result.getId() == null) throw new RuntimeException( String.format("The IU defined in %s is missing an id.", file.getAbsolutePath())); if (result.getVersion() == null) throw new RuntimeException( String.format("The IU defined in %s is missing a version.", file.getAbsolutePath())); return result; } finally { IOUtil.close(is); } }
/** * Parses the generic artifact information of a feature. * * @param in The input stream of the feature.xml * @return The generic description * @throws IOException If a parser error occurred */ private static GenericP2Artifact parseFeature(InputStream in) throws IOException { // no closing of input stream required - our caller will close the jar // at the end final Feature f = new Feature(new XMLParser().parse(new XMLIOSource(in))); return new GenericP2Artifact(f.getId(), f.getVersion(), P2ArtifactType.FEATURE); }
public static ProductConfiguration read(InputStream input) throws IOException { try { return new ProductConfiguration(parser.parse(new XMLIOSource(input))); } finally { IOUtil.close(input); } }
public static Category read(InputStream is) throws IOException { try { return new Category(parser.parse(new XMLIOSource(is))); } finally { IOUtil.close(is); } }
public static Category read(InputStream is) throws IOException { try { return new Category(parser.parse(new XMLIOSource(is))); } finally { IOUtil.close(is); } }