gpt4 book ai didi

org.apache.chemistry.opencmis.commons.impl.XMLUtils.skip()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 06:32:40 26 4
gpt4 key购买 nike

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

XMLUtils.skip介绍

[英]Skips a tag or subtree.
[中]跳过标记或子树。

代码示例

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

/**
 * Parses a link tag.
 */
private static AtomElement parseLink(XMLStreamReader parser) throws XMLStreamException {
  QName name = parser.getName();
  AtomLink result = new AtomLink();
  // save attributes
  for (int i = 0; i < parser.getAttributeCount(); i++) {
    if (LINK_REL.equals(parser.getAttributeLocalName(i))) {
      result.setRel(parser.getAttributeValue(i));
    } else if (LINK_HREF.equals(parser.getAttributeLocalName(i))) {
      result.setHref(parser.getAttributeValue(i));
    } else if (LINK_TYPE.equals(parser.getAttributeLocalName(i))) {
      result.setType(parser.getAttributeValue(i));
    }
  }
  // skip enclosed tags, if any
  XMLUtils.skip(parser);
  return new AtomElement(name, result);
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

/**
 * Parses a link tag.
 */
private static AtomElement parseAtomContentSrc(XMLStreamReader parser) throws XMLStreamException {
  QName name = parser.getName();
  AtomLink result = new AtomLink();
  result.setRel(LINK_REL_CONTENT);
  // save attributes
  for (int i = 0; i < parser.getAttributeCount(); i++) {
    if (CONTENT_SRC.equals(parser.getAttributeLocalName(i))) {
      result.setHref(parser.getAttributeValue(i));
    }
  }
  // skip enclosed tags, if any
  XMLUtils.skip(parser);
  return new AtomElement(name, result);
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

/**
 * Parses a workspace element.
 */
private static AtomElement parseWorkspaceElement(XMLStreamReader parser) throws XMLStreamException {
  QName name = parser.getName();
  if (XMLConstants.NAMESPACE_RESTATOM.equals(name.getNamespaceURI())) {
    if (TAG_REPOSITORY_INFO.equals(name.getLocalPart())) {
      return new AtomElement(name, XMLConverter.convertRepositoryInfo(parser));
    } else if (TAG_URI_TEMPLATE.equals(name.getLocalPart())) {
      return parseTemplate(parser);
    }
  } else if (XMLConstants.NAMESPACE_ATOM.equals(name.getNamespaceURI())) {
    if (TAG_LINK.equals(name.getLocalPart())) {
      return parseLink(parser);
    }
  } else if (XMLConstants.NAMESPACE_APP.equals(name.getNamespaceURI())) {
    if (TAG_COLLECTION.equals(name.getLocalPart())) {
      return parseCollection(parser);
    }
  }
  // we don't know it - skip it
  XMLUtils.skip(parser);
  return null;
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Parses a workspace element.
 */
private static AtomElement parseWorkspaceElement(XmlPullParser parser) throws XmlPullParserException {
  QName name = new QName(parser.getNamespace(), parser.getName());
  if (XMLConstants.NAMESPACE_RESTATOM.equals(name.getNamespaceURI())) {
    if (TAG_REPOSITORY_INFO.equals(name.getLocalPart())) {
      return new AtomElement(name, XMLConverter.convertRepositoryInfo(parser));
    } else if (TAG_URI_TEMPLATE.equals(name.getLocalPart())) {
      return parseTemplate(parser);
    }
  } else if (XMLConstants.NAMESPACE_ATOM.equals(name.getNamespaceURI())) {
    if (TAG_LINK.equals(name.getLocalPart())) {
      return parseLink(parser);
    }
  } else if (XMLConstants.NAMESPACE_APP.equals(name.getNamespaceURI())) {
    if (TAG_COLLECTION.equals(name.getLocalPart())) {
      return parseCollection(parser);
    }
  }
  // we don't know it - skip it
  XMLUtils.skip(parser);
  return null;
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

/**
 * Parses a collection tag.
 */
private static AtomElement parseCollection(XMLStreamReader parser) throws XMLStreamException {
  QName name = parser.getName();
  Map<String, String> result = new HashMap<String, String>();
  result.put("href", parser.getAttributeValue(null, "href"));
  XMLUtils.next(parser);
  while (true) {
    int event = parser.getEventType();
    if (event == XMLStreamConstants.START_ELEMENT) {
      QName tagName = parser.getName();
      if (XMLConstants.NAMESPACE_RESTATOM.equals(tagName.getNamespaceURI())
          && TAG_COLLECTION_TYPE.equals(tagName.getLocalPart())) {
        result.put("collectionType", XMLUtils.readText(parser, XMLConstraints.MAX_STRING_LENGTH));
      } else {
        XMLUtils.skip(parser);
      }
    } else if (event == XMLStreamConstants.END_ELEMENT) {
      break;
    } else {
      if (!XMLUtils.next(parser)) {
        break;
      }
    }
  }
  XMLUtils.next(parser);
  return new AtomElement(name, result);
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

/**
 * Parses an element.
 */
private AtomElement parseElement(XMLStreamReader parser) throws XMLStreamException {
  QName name = parser.getName();
  if (XMLConstants.NAMESPACE_RESTATOM.equals(name.getNamespaceURI())) {
    if (TAG_OBJECT.equals(name.getLocalPart())) {
      return new AtomElement(name, XMLConverter.convertObject(parser));
    } else if (TAG_PATH_SEGMENT.equals(name.getLocalPart())
        || TAG_RELATIVE_PATH_SEGMENT.equals(name.getLocalPart())) {
      return parseText(parser);
    } else if (TAG_TYPE.equals(name.getLocalPart())) {
      return new AtomElement(name, XMLConverter.convertTypeDefinition(parser));
    } else if (TAG_CHILDREN.equals(name.getLocalPart())) {
      return parseChildren(parser);
    }
  } else if (XMLConstants.NAMESPACE_ATOM.equals(name.getNamespaceURI())) {
    if (TAG_LINK.equals(name.getLocalPart())) {
      return parseLink(parser);
    } else if (TAG_CONTENT.equals(name.getLocalPart())) {
      return parseAtomContentSrc(parser);
    }
  }
  // we don't know it - skip it
  XMLUtils.skip(parser);
  return null;
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

result = new AtomElement(childName, parseFeed(parser));
} else {
  XMLUtils.skip(parser);
XMLUtils.skip(parser);

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Parses a service document.
 */
private static ServiceDoc parseServiceDoc(XmlPullParser parser) throws XmlPullParserException {
  ServiceDoc result = new ServiceDoc();
  XMLUtils.next(parser);
  while (true) {
    int event = parser.getEventType();
    if (event == XmlPullParser.START_TAG) {
      QName name = new QName(parser.getNamespace(), parser.getName());
      if (XMLConstants.NAMESPACE_APP.equals(name.getNamespaceURI())) {
        if (TAG_WORKSPACE.equals(name.getLocalPart())) {
          result.addWorkspace(parseWorkspace(parser));
        } else {
          XMLUtils.skip(parser);
        }
      } else {
        XMLUtils.skip(parser);
      }
    } else if (event == XmlPullParser.END_TAG) {
      break;
    } else {
      if (!XMLUtils.next(parser)) {
        break;
      }
    }
  }
  return result;
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

result.put("type", XMLUtils.readText(parser, XMLConstraints.MAX_STRING_LENGTH));
} else {
  XMLUtils.skip(parser);
XMLUtils.skip(parser);

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

/**
 * Parses a service document.
 */
private static ServiceDoc parseServiceDoc(XMLStreamReader parser) throws XMLStreamException {
  ServiceDoc result = new ServiceDoc();
  XMLUtils.next(parser);
  while (true) {
    int event = parser.getEventType();
    if (event == XMLStreamConstants.START_ELEMENT) {
      QName name = parser.getName();
      if (XMLConstants.NAMESPACE_APP.equals(name.getNamespaceURI())) {
        if (TAG_WORKSPACE.equals(name.getLocalPart())) {
          result.addWorkspace(parseWorkspace(parser));
        } else {
          XMLUtils.skip(parser);
        }
      } else {
        XMLUtils.skip(parser);
      }
    } else if (event == XMLStreamConstants.END_ELEMENT) {
      break;
    } else {
      if (!XMLUtils.next(parser)) {
        break;
      }
    }
  }
  return result;
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

result.put("type", XMLUtils.readText(parser, XMLConstraints.MAX_STRING_LENGTH));
} else {
  XMLUtils.skip(parser);
XMLUtils.skip(parser);

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

result = new AtomElement(childName, parseFeed(parser));
} else {
  XMLUtils.skip(parser);
XMLUtils.skip(parser);

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Parses a collection tag.
 */
private static AtomElement parseCollection(XmlPullParser parser) throws XmlPullParserException {
  QName name = new QName(parser.getNamespace(), parser.getName());
  Map<String, String> result = new HashMap<String, String>();
  result.put("href", parser.getAttributeValue(null, "href"));
  XMLUtils.next(parser);
  while (true) {
    int event = parser.getEventType();
    if (event == XmlPullParser.START_TAG) {
      QName tagName = new QName(parser.getNamespace(), parser.getName());
      if (XMLConstants.NAMESPACE_RESTATOM.equals(tagName.getNamespaceURI())
          && TAG_COLLECTION_TYPE.equals(tagName.getLocalPart())) {
        result.put("collectionType", XMLUtils.readText(parser, XMLConstraints.MAX_STRING_LENGTH));
      } else {
        XMLUtils.skip(parser);
      }
    } else if (event == XmlPullParser.END_TAG) {
      break;
    } else {
      if (!XMLUtils.next(parser)) {
        break;
      }
    }
  }
  XMLUtils.next(parser);
  return new AtomElement(name, result);
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Parses an element.
 * 
 * @throws XmlPullParserException
 */
private AtomElement parseElement(XmlPullParser parser) throws XmlPullParserException {
  QName name = new QName(parser.getNamespace(), parser.getName());
  if (XMLConstants.NAMESPACE_RESTATOM.equals(name.getNamespaceURI())) {
    if (TAG_OBJECT.equals(name.getLocalPart())) {
      return new AtomElement(name, XMLConverter.convertObject(parser));
    } else if (TAG_PATH_SEGMENT.equals(name.getLocalPart())
        || TAG_RELATIVE_PATH_SEGMENT.equals(name.getLocalPart())) {
      return parseText(parser);
    } else if (TAG_TYPE.equals(name.getLocalPart())) {
      return new AtomElement(name, XMLConverter.convertTypeDefinition(parser));
    } else if (TAG_CHILDREN.equals(name.getLocalPart())) {
      return parseChildren(parser);
    }
  } else if (XMLConstants.NAMESPACE_ATOM.equals(name.getNamespaceURI())) {
    if (TAG_LINK.equals(name.getLocalPart())) {
      return parseLink(parser);
    } else if (TAG_CONTENT.equals(name.getLocalPart())) {
      return parseAtomContentSrc(parser);
    }
  }
  // we don't know it - skip it
  XMLUtils.skip(parser);
  return null;
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

result.addEntry(parseEntry(parser));
} else {
  XMLUtils.skip(parser);
  result.addElement(parseBigInteger(parser));
} else {
  XMLUtils.skip(parser);
XMLUtils.skip(parser);

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-server-bindings

parseCmisContent(parser);
} else {
  XMLUtils.skip(parser);
  atomTitle = XMLUtils.readText(parser, XMLConstraints.MAX_STRING_LENGTH);
} else {
  XMLUtils.skip(parser);
XMLUtils.skip(parser);

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Parses a link tag.
 */
private static AtomElement parseLink(XmlPullParser parser) throws XmlPullParserException {
  QName name = new QName(parser.getNamespace(), parser.getName());
  AtomLink result = new AtomLink();
  // save attributes
  for (int i = 0; i < parser.getAttributeCount(); i++) {
    if (LINK_REL.equals(parser.getAttributeName(i))) {
      result.setRel(parser.getAttributeValue(i));
    } else if (LINK_HREF.equals(parser.getAttributeName(i))) {
      result.setHref(parser.getAttributeValue(i));
    } else if (LINK_TYPE.equals(parser.getAttributeName(i))) {
      result.setType(parser.getAttributeValue(i));
    }
  }
  // skip enclosed tags, if any
  XMLUtils.skip(parser);
  return new AtomElement(name, result);
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Parses a link tag.
 */
private static AtomElement parseAtomContentSrc(XmlPullParser parser) throws XmlPullParserException {
  QName name = new QName(parser.getNamespace(), parser.getName());
  AtomLink result = new AtomLink();
  result.setRel(LINK_REL_CONTENT);
  // save attributes
  for (int i = 0; i < parser.getAttributeCount(); i++) {
    if (CONTENT_SRC.equals(parser.getAttributeName(i))) {
      result.setHref(parser.getAttributeValue(i));
    }
  }
  // skip enclosed tags, if any
  XMLUtils.skip(parser);
  return new AtomElement(name, result);
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

public T walk(XmlPullParser parser) throws XmlPullParserException {
  final T result = prepareTarget(parser, new QName(parser.getNamespace(), parser.getName()));
  next(parser);
  // walk through all tags
  while (true) {
    int event = parser.getEventType();
    if (event == XmlPullParser.START_TAG) {
      QName name = new QName(parser.getNamespace(), parser.getName());
      if (!read(parser, name, result)) {
        if (result instanceof ExtensionsData) {
          handleExtension(parser, (ExtensionsData) result);
        } else {
          skip(parser);
        }
      }
    } else if (event == XmlPullParser.END_TAG) {
      break;
    } else {
      if (!next(parser)) {
        break;
      }
    }
  }
  next(parser);
  return result;
}

代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-commons-impl

public T walk(XMLStreamReader parser) throws XMLStreamException {
  assert parser != null;
  final T result = prepareTarget(parser, parser.getName());
  next(parser);
  // walk through all tags
  while (true) {
    int event = parser.getEventType();
    if (event == XMLStreamConstants.START_ELEMENT) {
      QName name = parser.getName();
      if (!read(parser, name, result)) {
        if (result instanceof ExtensionsData) {
          handleExtension(parser, (ExtensionsData) result);
        } else {
          skip(parser);
        }
      }
    } else if (event == XMLStreamConstants.END_ELEMENT) {
      break;
    } else {
      if (!next(parser)) {
        break;
      }
    }
  }
  next(parser);
  return result;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com