APISonar


com.google.caja.util.Name.xml

> com > google > caja > util > Name > xml
com APIs google APIs caja APIs util APIs Name APIs xml APIs

Example 1
public Name canonicalizeAttributeName(String attributeName) {
    // This will need to change if we start accepting namespaced XML.
    return Name.xml(attributeName);
  }
Example 2
private void readRequiredFeatures(DomTree doc, GadgetSpec spec)
      throws GadgetRewriteException {
    for (DomTree.Tag require : getElementsByTagName(doc, Name.xml("Require"))) {
      List<DomTree.Attrib> attribs = require.getAttributeNodes();
      check(attribs.size() == 1
            && "feature".equals(
                attribs.get(0).getAttribName().getCanonicalForm()),
            "<Require> can only have a \"feature\" attribute");
      spec.getRequiredFeatures().add(attribs.get(0).getAttribValue());
    }
  }
Example 3
private void readModulePrefs(DomTree doc, GadgetSpec spec)
      throws GadgetRewriteException {
    List<DomTree.Tag> list = getElementsByTagName(doc, Name.xml("ModulePrefs"));
    check(list.size() == 1, "Must have exactly one <ModulePrefs>");
    DomTree.Tag modulePrefs = list.get(0);
    for (DomTree.Attrib attr : modulePrefs.getAttributeNodes()) {
      spec.getModulePrefs().put(
          attr.getAttribName().getCanonicalForm(), attr.getAttribValue());
    }
  }