android.util.Xml.parse()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中android.util.Xml.parse()方法的一些代码示例,展示了Xml.parse()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Xml.parse()方法的具体详情如下:
包路径:android.util.Xml
类名称:Xml
方法名:parse

Xml.parse介绍

暂无

代码示例

代码示例来源:origin: Jiangzqts/EpubRead

public static boolean parseQuietly(ZLFile file, DefaultHandler handler) {
    try {
      Xml.parse(file.getInputStream(), Xml.Encoding.UTF_8, handler);
      return true;
    } catch (Exception e) {
      return false;
    }
  }
}

代码示例来源:origin: Wilm0r/giggity

private void loadXml(BufferedReader in, ContentHandler parser) {
  try {
    Xml.parse(in, parser);
    in.close();
  } catch (Exception e) {
    Log.e("Schedule.loadXml", "XML parse exception: " + e);
    e.printStackTrace();
    throw new LoadException("XML parsing problem: " + e);
  }
}

代码示例来源:origin: adolfAn/FBReader_AS

public static boolean parseQuietly(ZLFile file, DefaultHandler handler) {
    try {
      Xml.parse(file.getInputStream(), Xml.Encoding.UTF_8, handler);
      return true;
    } catch (Exception e) {
      return false;
    }
  }
}

代码示例来源:origin: adolfAn/FBReader_AS

@Override
public <B extends AbstractBook> B deserializeBook(String xml, BookCreator<B> creator) {
  try {
    final BookDeserializer<B> deserializer = new BookDeserializer<B>(creator);
    Xml.parse(xml, deserializer);
    return deserializer.getBook();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: ydcx/KooReader

@Override
public BookQuery deserializeBookQuery(String xml) {
  try {
    final BookQueryDeserializer deserializer = new BookQueryDeserializer();
    Xml.parse(xml, deserializer);
    return deserializer.getQuery();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
public BookQuery deserializeBookQuery(String xml) {
  try {
    final BookQueryDeserializer deserializer = new BookQueryDeserializer();
    Xml.parse(xml, deserializer);
    return deserializer.getQuery();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: ydcx/KooReader

@Override
public <B extends AbstractBook> B deserializeBook(String xml, BookCreator<B> creator) {
  try {
    final BookDeserializer<B> deserializer = new BookDeserializer<B>(creator);
    Xml.parse(xml, deserializer);
    return deserializer.getBook();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
public BookmarkQuery deserializeBookmarkQuery(String xml, BookCreator<? extends AbstractBook> creator) {
  try {
    final BookmarkQueryDeserializer deserializer = new BookmarkQueryDeserializer(creator);
    Xml.parse(xml, deserializer);
    return deserializer.getQuery();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
public <B extends AbstractBook> B deserializeBook(String xml, BookCreator<B> creator) {
  try {
    final BookDeserializer<B> deserializer = new BookDeserializer<B>(creator);
    Xml.parse(xml, deserializer);
    return deserializer.getBook();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: adolfAn/FBReader_AS

@Override
public Bookmark deserializeBookmark(String xml) {
  try {
    final BookmarkDeserializer deserializer = new BookmarkDeserializer();
    Xml.parse(xml, deserializer);
    return deserializer.getBookmark();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: ydcx/KooReader

@Override
public BookmarkQuery deserializeBookmarkQuery(String xml, BookCreator<? extends AbstractBook> creator) {
  try {
    final BookmarkQueryDeserializer deserializer = new BookmarkQueryDeserializer(creator);
    Xml.parse(xml, deserializer);
    return deserializer.getQuery();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: ydcx/KooReader

@Override
public Bookmark deserializeBookmark(String xml) {
  try {
    final BookmarkDeserializer deserializer = new BookmarkDeserializer();
    Xml.parse(xml, deserializer);
    return deserializer.getBookmark();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: adolfAn/FBReader_AS

@Override
public HighlightingStyle deserializeStyle(String xml) {
  try {
    final StyleDeserializer deserializer = new StyleDeserializer();
    Xml.parse(xml, deserializer);
    return deserializer.getStyle();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: ydcx/KooReader

@Override
public HighlightingStyle deserializeStyle(String xml) {
  try {
    final StyleDeserializer deserializer = new StyleDeserializer();
    Xml.parse(xml, deserializer);
    return deserializer.getStyle();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
public HighlightingStyle deserializeStyle(String xml) {
  try {
    final StyleDeserializer deserializer = new StyleDeserializer();
    Xml.parse(xml, deserializer);
    return deserializer.getStyle();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: adolfAn/FBReader_AS

@Override
public BookQuery deserializeBookQuery(String xml) {
  try {
    final BookQueryDeserializer deserializer = new BookQueryDeserializer();
    Xml.parse(xml, deserializer);
    return deserializer.getQuery();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: adolfAn/FBReader_AS

@Override
public BookmarkQuery deserializeBookmarkQuery(String xml, BookCreator<? extends AbstractBook> creator) {
  try {
    final BookmarkQueryDeserializer deserializer = new BookmarkQueryDeserializer(creator);
    Xml.parse(xml, deserializer);
    return deserializer.getQuery();
  } catch (SAXException e) {
    System.err.println(xml);
    e.printStackTrace();
    return null;
  }
}

代码示例来源:origin: adolfAn/FBReader_AS

FilteredEncodingCollection() {
  try {
    final ZLResourceFile file = ZLResourceFile.createResourceFile("encodings/Encodings.xml");
    Xml.parse(file.getInputStream(), Xml.Encoding.UTF_8, new EncodingCollectionReader());
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

FilteredEncodingCollection() {
  LogInfo.i("encodings");
  try {
    final ZLResourceFile file = ZLResourceFile.createResourceFile("encodings/Encodings.xml");
    Xml.parse(file.getInputStream(), Xml.Encoding.UTF_8, new EncodingCollectionReader());
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: ydcx/KooReader

FilteredEncodingCollection() {
  LogInfo.i("encodings");
  try {
    final ZLResourceFile file = ZLResourceFile.createResourceFile("encodings/Encodings.xml");
    Xml.parse(file.getInputStream(), Xml.Encoding.UTF_8, new EncodingCollectionReader());
  } catch (Exception e) {
    e.printStackTrace();
  }
}

相关文章