gpt4 book ai didi

javolution.xml.stream.XMLStreamReader.getLocalName()方法的使用及代码示例

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

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

XMLStreamReader.getLocalName介绍

[英]Returns the (local) name of the current event. For START_ELEMENT or END_ELEMENT returns the (local) name of the current element. For ENTITY_REFERENCE it returns entity name. The current event must be START_ELEMENT or END_ELEMENT, or ENTITY_REFERENCE.
[中]返回当前事件的(本地)名称。对于START_元素或END_元素,返回当前元素的(本地)名称。对于实体_REFERENCE,它返回实体名称。当前事件必须是开始元素、结束元素或实体引用。

代码示例

代码示例来源:origin: org.mobicents.protocols.ss7.map/map-impl

@Override
public void read(javolution.xml.XMLFormat.InputElement xml, ArrayListSerializingBase data) throws XMLStreamException {
  data.data.clear();
  while (xml.hasNext()) {
    String localName = xml.getStreamReader().getLocalName().toString();
    if (localName.equals(data.elementName)) {
      data.data.add(xml.get(data.elementName, data.classDef));
    } else
      throw new XMLStreamException("Only <" + data.elementName + "> elements are allowed in this list. Found: " + localName);
  }
}

代码示例来源:origin: org.restcomm.protocols.ss7.map/map-impl

@Override
public void read(javolution.xml.XMLFormat.InputElement xml, ArrayListSerializingBase data) throws XMLStreamException {
  data.data.clear();
  while (xml.hasNext()) {
    String localName = xml.getStreamReader().getLocalName().toString();
    if (localName.equals(data.elementName)) {
      data.data.add(xml.get(data.elementName, data.classDef));
    } else
      throw new XMLStreamException("Only <" + data.elementName + "> elements are allowed in this list. Found: " + localName);
  }
}

代码示例来源:origin: io.github.msdk/msdk-io-mzxml

/**
 * <p>
 * Gets the required attribute from xmlStreamReader, throws an exception of the attribute is not
 * found
 * </p>
 *
 * @return a CharArray containing the value of the attribute.
 * @param xmlStreamReader a {@link javolution.xml.stream.XMLStreamReader} object.
 * @param attr a {@link java.lang.String} object.
 */
public CharArray getRequiredAttribute(XMLStreamReader xmlStreamReader, String attr) {
 CharArray attrValue = xmlStreamReader.getAttributeValue(null, attr);
 if (attrValue == null)
  throw new IllegalStateException("Tag " + xmlStreamReader.getLocalName() + " must provide an `"
    + attr + "`attribute (Line " + xmlStreamReader.getLocation().getLineNumber() + ")");
 return attrValue;
}

代码示例来源:origin: io.github.msdk/msdk-io-mzml

/**
 * <p>
 * Gets the required attribute from xmlStreamReader, throws an exception if the attribute is not
 * found
 * </p>
 *
 * @param xmlStreamReader XMLStreamReader instance used to parse
 * @param attr Attribute's value to be found
 * @return a CharArray containing the value of the attribute.
 */
public CharArray getRequiredAttribute(XMLStreamReader xmlStreamReader, String attr) {
 CharArray attrValue = xmlStreamReader.getAttributeValue(null, attr);
 if (attrValue == null)
  throw new IllegalStateException("Tag " + xmlStreamReader.getLocalName() + " must provide an `"
    + attr + "`attribute (Line " + xmlStreamReader.getLocation().getLineNumber() + ")");
 return attrValue;
}

代码示例来源:origin: msdk/msdk

/**
 * <p>
 * Gets the required attribute from xmlStreamReader, throws an exception if the attribute is not
 * found
 * </p>
 *
 * @param xmlStreamReader XMLStreamReader instance used to parse
 * @param attr Attribute's value to be found
 * @return a CharArray containing the value of the attribute.
 */
public CharArray getRequiredAttribute(XMLStreamReader xmlStreamReader, String attr) {
 CharArray attrValue = xmlStreamReader.getAttributeValue(null, attr);
 if (attrValue == null)
  throw new IllegalStateException("Tag " + xmlStreamReader.getLocalName() + " must provide an `"
    + attr + "`attribute (Line " + xmlStreamReader.getLocation().getLineNumber() + ")");
 return attrValue;
}

代码示例来源:origin: msdk/msdk

/**
 * <p>
 * Gets the required attribute from xmlStreamReader, throws an exception of the attribute is not
 * found
 * </p>
 *
 * @return a CharArray containing the value of the attribute.
 * @param xmlStreamReader a {@link javolution.xml.stream.XMLStreamReader} object.
 * @param attr a {@link java.lang.String} object.
 */
public CharArray getRequiredAttribute(XMLStreamReader xmlStreamReader, String attr) {
 CharArray attrValue = xmlStreamReader.getAttributeValue(null, attr);
 if (attrValue == null)
  throw new IllegalStateException("Tag " + xmlStreamReader.getLocalName() + " must provide an `"
    + attr + "`attribute (Line " + xmlStreamReader.getLocation().getLineNumber() + ")");
 return attrValue;
}

代码示例来源:origin: javolution/javolution

break;
case XMLStreamReader.START_ELEMENT:
  System.out.println("Start Element: " + xml.getLocalName() + "("
      + xml.getNamespaceURI() + ")");
  for (int i = 0, n = xml.getAttributeCount(); i < n; i++) {
  if (xml.getLocalName().equals("Body")
      && xml.getNamespaceURI().equals(ENVELOPE_URI))
    return; // End body.
  System.out.println("End Element: " + xml.getLocalName() + "("
      + xml.getNamespaceURI() + ")");
  break;

代码示例来源:origin: org.javolution/javolution-core-java

break;
case XMLStreamReader.START_ELEMENT:
  System.out.println("Start Element: " + xml.getLocalName()
      + "(" + xml.getNamespaceURI() + ")");
  for (int i = 0, n = xml.getAttributeCount(); i < n; i++) {
  if (xml.getLocalName().equals("Body")
      && xml.getNamespaceURI().equals(ENVELOPE_URI))
    return; // End body.
  System.out.println("End Element: " + xml.getLocalName()
      + "(" + xml.getNamespaceURI() + ")");
  break;

代码示例来源:origin: org.javolution/javolution-core-java

} else {
  classQName = QName.valueOf(reader.getNamespaceURI(),
      reader.getLocalName());

代码示例来源:origin: org.javolution/javolution-core-java

while (xmlIn.hasNext()) {
  if ((xmlIn.next() == XMLStreamReader.START_ELEMENT)
      && xmlIn.getLocalName().equals("Body")
      && xmlIn.getNamespaceURI().equals(ENVELOPE_URI)) {

代码示例来源:origin: javolution/javolution

while (xmlIn.hasNext()) {
  if ((xmlIn.next() == XMLStreamReader.START_ELEMENT)
      && xmlIn.getLocalName().equals("Body")
      && xmlIn.getNamespaceURI().equals(ENVELOPE_URI)) {

代码示例来源:origin: javolution/javolution

} else {
  classQName = QName.valueOf(reader.getNamespaceURI(), reader
      .getLocalName());

26 4 0