Package org.xmlpull.mxp1

Examples of org.xmlpull.mxp1.MXParserCachingStrings


public class XmlPullStreamReaderTest
    extends AbstractXFireTest
{
    public void testParser() throws Exception
    {
        MXParser parser = new MXParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
       
        parser.setInput(getClass().getResourceAsStream("echo.xml"), null);
       
        XmlPullStreamReader reader = new XmlPullStreamReader(parser);
       
        StaxBuilder builder = new StaxBuilder();
        Document doc = builder.build(reader);
View Full Code Here


      final Nifty nifty) throws Exception {
    try {
      long start = timeProvider.getMsTime();
      log.info("loading new nifty xml file with schemaId [" + schemaId + "]");

      XmlParser parser = new XmlParser(new MXParser());
      parser.read(inputStreamXml);

      NiftyType niftyType = (NiftyType) getSchema(schemaId).loadXml(parser);
      niftyType.loadStyles(this, nifty);
      niftyType.loadControls(this);
View Full Code Here

      final String styleFilename,
      final NiftyType niftyType,
      final Nifty nifty) throws Exception {
    log.info("loading new nifty style xml file [" + styleFilename + "] with schemaId [" + schemaId + "]");

    XmlParser parser = new XmlParser(new MXParser());
    InputStream stream = ResourceLoader.getResourceAsStream(styleFilename);
    try {
      parser.read(stream);
      NiftyStylesType niftyStylesType = (NiftyStylesType) getSchema(schemaId).loadXml(parser);
      niftyStylesType.loadStyles(this, niftyType, nifty, log);
View Full Code Here

      final String schemaId,
      final String controlFilename,
      final NiftyType niftyType) throws Exception {
    log.info("loading new nifty controls xml file [" + controlFilename + "] with schemaId [" + schemaId + "]");

    XmlParser parser = new XmlParser(new MXParser());
    InputStream stream = ResourceLoader.getResourceAsStream(controlFilename);
    try {
      parser.read(stream);
      NiftyControlsType niftyControlsType = (NiftyControlsType) getSchema(schemaId).loadXml(parser);
      niftyControlsType.loadControls(this, niftyType);
View Full Code Here

  }

  public void registerSchema(final String schemaId, final InputStream inputStreamSchema) throws Exception {
    try {
      Schema niftyXmlSchema = new Schema();
      XmlParser parser = new XmlParser(new MXParser());
      parser.read(inputStreamSchema);
      parser.nextTag();
      parser.required("nxs", niftyXmlSchema);
      schemes.put(schemaId, niftyXmlSchema);
    } finally {
View Full Code Here

      final XmlParser xmlParser,
      final Attributes attributes) throws Exception {
    String filename = attributes.get("filename");

    Schema niftyXmlSchema = new Schema();
    XmlParser parser = new XmlParser(new MXParser());
    InputStream stream = ResourceLoader.getResourceAsStream(filename);
    try {
      parser.read(stream);
      parser.nextTag();
      parser.required("nxs", niftyXmlSchema);
View Full Code Here

        super(nameCoder);
    }

    @Override
    protected XmlPullParser createParser() {
        return new MXParser();
    }
View Full Code Here

    /**
     * @deprecated As of 1.4, use {@link XppDom#build(XmlPullParser)} instead
     */
    @Deprecated
    public static Xpp3Dom build(final Reader reader) throws Exception {
        final XmlPullParser parser = new MXParser();
        parser.setInput(reader);
        try {
            return (Xpp3Dom)XppDom.build(parser);
        } finally {
            reader.close();
        }
View Full Code Here

        super(nameCoder);
    }

    @Override
    protected XmlPullParser createParser() {
        return new MXParser();
    }
View Full Code Here

    public List<IconDef> getIcons() { return icons; }
    public IconSetExtension(IConfigurationElement element) {
      type = element.getName();
      id = element.getAttribute(ID_ATTRIBUTE);
      icondef = element.getAttribute(ICONDEF_ATTRIBUTE);
      MXParser parser = new MXParser();
      Bundle bundle = Platform.getBundle(element.getDeclaringExtension().getNamespaceIdentifier());
      URL icondefurl = FileLocator.find(bundle,new Path(icondef),null);
      IPath path2 = new Path(icondef).removeLastSegments(1);
      URL path2url = FileLocator.find(bundle,path2,null);
      String path = icondefurl.getPath();
      logger.finer("path: " + path);
      logger.finer("path2url: " + path2url.toString());
      try {
        URL url = FileLocator.resolve(path2url);
        logger.finer("path2url-resolved: " + url.toString());
        rootpath = url.toString();
      } catch (IOException e1) {
        e1.printStackTrace();
      }
      try {
        parser.setInput(icondefurl.openStream(),"UTF-8");
        parseIconDef(parser);
      } catch (XmlPullParserException e) {
        e.printStackTrace();
      } catch (IOException e) {
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.xmlpull.mxp1.MXParserCachingStrings

Copyright © 2018 www.massapicom. 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.