Codota Logo
XmlUtils.parseDocumentSilently
Code IndexAdd Codota to your IDE (free)

How to use
parseDocumentSilently
method
in
com.android.utils.XmlUtils

Best Java code snippets using com.android.utils.XmlUtils.parseDocumentSilently (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: com.android.tools.build/gradle-core

protected void readManifest(File manifest) {
  if (manifest.exists()) {
    try {
      String xml = Files.toString(manifest, Charsets.UTF_8);
      Document document = XmlUtils.parseDocumentSilently(xml, true);
      if (document != null) {
        readManifest(document);
      }
    } catch (IOException e) {
      client.log(e, "Could not read manifest %1$s", manifest);
    }
  }
}
origin: com.amazon.device.tools.build/gradle-core

protected void readManifest(File manifest) {
  if (manifest.exists()) {
    try {
      String xml = Files.toString(manifest, Charsets.UTF_8);
      Document document = XmlUtils.parseDocumentSilently(xml, true);
      if (document != null) {
        readManifest(document);
      }
    } catch (IOException e) {
      mClient.log(e, "Could not read manifest %1$s", manifest);
    }
  }
}
origin: com.amazon.device.tools.lint/lint-checks

  @NonNull Set<String> revocable,
  @NonNull File manifest) {
Document document = XmlUtils.parseDocumentSilently(client.readFile(manifest), true);
if (document == null) {
  return;
origin: com.amazon.device.tools.lint/lint-checks

@Nullable
private Multimap<String, String> getIdToTagsIn(@NonNull Context context, @NonNull File file) {
  if (!file.getPath().endsWith(DOT_XML)) {
    return null;
  }
  if (mFileIdMap == null) {
    mFileIdMap = Maps.newHashMap();
  }
  Multimap<String, String> map = mFileIdMap.get(file);
  if (map == null) {
    map = ArrayListMultimap.create();
    mFileIdMap.put(file, map);
    String xml = context.getClient().readFile(file);
    // TODO: Use pull parser instead for better performance!
    Document document = XmlUtils.parseDocumentSilently(xml, true);
    if (document != null && document.getDocumentElement() != null) {
      addViewTags(map, document.getDocumentElement());
    }
  }
  return map;
}
origin: com.android.tools.lint/lint-tests

try {
  String xml = Files.toString(file, Charsets.UTF_8);
  Document document = XmlUtils.parseDocumentSilently(xml, true);
  assertNotNull(document);
  Set<String> ids = Sets.newHashSet();
origin: com.android.tools.lint/lint-tests

try {
  String xml = Files.toString(file, Charsets.UTF_8);
  Document document = XmlUtils.parseDocumentSilently(xml, true);
  assertNotNull(document);
  Set<String> ids = Sets.newHashSet();
com.android.utilsXmlUtilsparseDocumentSilently

Javadoc

Parses the given XML string as a DOM document, using the JDK parser. The parser does not validate, and is optionally namespace aware. Any parsing errors are silently ignored.

Popular methods of XmlUtils

  • parseDocument
    Parses the given XML string as a DOM document, using the JDK parser. The parser does not validate, a
  • parseUtfXmlFile
    Parses the given UTF file as a DOM document, using the JDK parser. The parser does not validate, and
  • toXmlAttributeValue
    Converts the given attribute value to an XML-attribute-safe value, meaning that single and double qu
  • toXml
  • toXmlTextValue
    Converts the given attribute value to an XML-text-safe value, meaning that less than and ampersand c
  • fromXmlAttributeValue
    Converts the given XML-attribute-safe value to a java string
  • getRootTagName
    Returns the name of the root element tag stored in the given file, or null if it can't be determined
  • getUtfReader
    Returns a character reader for the given file, which must be a UTF encoded file. The reader does no
  • lookupNamespacePrefix
    Returns the namespace prefix matching the requested namespace URI. If no such declaration is found,
  • append
    Dump node to string without indentation adjustments
  • appendXmlAttributeValue
    Appends text to the given StringBuilder and escapes it as required for a DOM attribute node.
  • appendXmlTextValue
    Appends text to the given StringBuilder and escapes it as required for a DOM text node.
  • appendXmlAttributeValue,
  • appendXmlTextValue,
  • getSourceFilePosition,
  • stripBom

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • findViewById (Activity)
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Path (java.nio.file)
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now