gpt4 book ai didi

org.restlet.ext.xml.XmlWriter.endElement()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 15:21:05 27 4
gpt4 key购买 nike

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

XmlWriter.endElement介绍

[英]End an element without a Namespace URI or qname.

This method will supply an empty string for the qName and an empty string for the Namespace URI. It invokes #endElement(String,String,String) directly.
[中]结束一个没有名称空间URI或qname的元素。
此方法将为qName提供空字符串,为命名空间URI提供空字符串。它直接调用#endElement(String,String,String)。

代码示例

代码示例来源:origin: org.restlet.jee/org.restlet.ext.xml

/**
 * End an element without a Namespace URI or qname.
 * 
 * <p>
 * This method will supply an empty string for the qName and an empty string
 * for the Namespace URI. It invokes
 * {@link #endElement(String, String, String)} directly.
 * </p>
 * 
 * @param localName
 *            The element's local name.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the end tag, or if a restlet
 *                further down the filter chain raises an exception.
 * @see #endElement(String, String, String)
 */
public void endElement(String localName) throws SAXException {
  endElement("", localName, "");
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.xml

/**
 * End an element without a qname.
 * 
 * <p>
 * This method will supply an empty string for the qName. It invokes
 * {@link #endElement(String, String, String)} directly.
 * </p>
 * 
 * @param uri
 *            The element's Namespace URI.
 * @param localName
 *            The element's local name.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the end tag, or if a restlet
 *                further down the filter chain raises an exception.
 * @see #endElement(String, String, String)
 */
public void endElement(String uri, String localName) throws SAXException {
  endElement(uri, localName, "");
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.xml

/**
 * End an element without a Namespace URI or qname.
 * 
 * <p>
 * This method will supply an empty string for the qName and an empty string
 * for the Namespace URI. It invokes
 * {@link #endElement(String, String, String)} directly.
 * </p>
 * 
 * @param localName
 *            The element's local name.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the end tag, or if a restlet
 *                further down the filter chain raises an exception.
 * @see #endElement(String, String, String)
 */
public void endElement(String localName) throws SAXException {
  endElement("", localName, "");
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.xml

/**
 * End an element without a qname.
 * 
 * <p>
 * This method will supply an empty string for the qName. It invokes
 * {@link #endElement(String, String, String)} directly.
 * </p>
 * 
 * @param uri
 *            The element's Namespace URI.
 * @param localName
 *            The element's local name.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the end tag, or if a restlet
 *                further down the filter chain raises an exception.
 * @see #endElement(String, String, String)
 */
public void endElement(String uri, String localName) throws SAXException {
  endElement(uri, localName, "");
}

代码示例来源:origin: org.restlet/org.restlet.ext.xml

/**
 * End an element without a Namespace URI or qname.
 * 
 * <p>
 * This method will supply an empty string for the qName and an empty string
 * for the Namespace URI. It invokes
 * {@link #endElement(String, String, String)} directly.
 * </p>
 * 
 * @param localName
 *            The element's local name.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the end tag, or if a restlet
 *                further down the filter chain raises an exception.
 * @see #endElement(String, String, String)
 */
public void endElement(String localName) throws SAXException {
  endElement("", localName, "");
}

代码示例来源:origin: org.restlet/org.restlet.ext.xml

/**
 * End an element without a qname.
 * 
 * <p>
 * This method will supply an empty string for the qName. It invokes
 * {@link #endElement(String, String, String)} directly.
 * </p>
 * 
 * @param uri
 *            The element's Namespace URI.
 * @param localName
 *            The element's local name.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the end tag, or if a restlet
 *                further down the filter chain raises an exception.
 * @see #endElement(String, String, String)
 */
public void endElement(String uri, String localName) throws SAXException {
  endElement(uri, localName, "");
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.atom

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @param namespace
 *            The element namespace URI.
 * @param localName
 *            The local name of the element.
 * @throws SAXException
 */
public static void writeElement(XmlWriter writer, Date date,
    String namespace, String localName) throws SAXException {
  if (date != null) {
    writer.startElement(namespace, localName);
    writer.characters(DateUtils.format(date,
        DateUtils.FORMAT_RFC_3339.get(0)));
    writer.endElement(namespace, localName);
  } else {
    writer.emptyElement(namespace, localName);
  }
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.atom

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @param namespace
 *            The element namespace URI.
 * @param localName
 *            The local name of the element.
 * @throws SAXException
 */
public static void writeElement(XmlWriter writer, Date date,
    String namespace, String localName) throws SAXException {
  if (date != null) {
    writer.startElement(namespace, localName);
    writer.characters(DateUtils.format(date, DateUtils.FORMAT_RFC_3339
        .get(0)));
    writer.endElement(namespace, localName);
  } else {
    writer.emptyElement(namespace, localName);
  }
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.atom

/**
   * Writes the representation to a XML writer.
   * 
   * @param writer
   *            The XML writer to write to.
   * @throws SAXException
   */
  public void writeElement(XmlWriter writer) throws SAXException {
    writer.startElement(APP_NAMESPACE, "categories");

    for (final Category entry : getEntries()) {
      entry.writeElement(writer);
    }

    writer.endElement(APP_NAMESPACE, "categories");
    writer.endDocument();
  }
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.atom

/**
   * Writes the representation to a XML writer.
   * 
   * @param writer
   *            The XML writer to write to.
   * @throws SAXException
   */
  public void writeElement(XmlWriter writer) throws SAXException {
    writer.startElement(APP_NAMESPACE, "categories");

    for (final Category entry : getEntries()) {
      entry.writeElement(writer);
    }

    writer.endElement(APP_NAMESPACE, "categories");
    writer.endDocument();
  }
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @throws SAXException
 */
public void writeElement(XmlWriter writer) throws SAXException {
  final AttributesImpl attributes = new AttributesImpl();
  if ((getValue() != null) && !getValue().equals("")) {
    attributes.addAttribute("", "id", null, "xs:string", getValue());
  }
  if (getDocumentations().isEmpty()) {
    writer.emptyElement(APP_NAMESPACE, "option", null, attributes);
  } else {
    writer.startElement(APP_NAMESPACE, "option", null, attributes);
    for (final DocumentationInfo documentationInfo : getDocumentations()) {
      documentationInfo.writeElement(writer);
    }
    writer.endElement(APP_NAMESPACE, "option");
  }
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @throws SAXException
 */
public void writeElement(XmlWriter writer) throws SAXException {
  if (getDocumentations().isEmpty() && getIncludes().isEmpty()) {
    writer.emptyElement(APP_NAMESPACE, "grammars");
  } else {
    writer.startElement(APP_NAMESPACE, "grammars");
    for (final DocumentationInfo documentationInfo : getDocumentations()) {
      documentationInfo.writeElement(writer);
    }
    for (final IncludeInfo includeInfo : getIncludes()) {
      includeInfo.writeElement(writer);
    }
    writer.endElement(APP_NAMESPACE, "grammars");
  }
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl

/**
   * Writes the current object as an XML element using the given SAX writer.
   * 
   * @param writer
   *            The SAX writer.
   * @throws SAXException
   */
  public void writeElement(XmlWriter writer) throws SAXException {
    final AttributesImpl attributes = new AttributesImpl();
    if ((getTargetRef() != null) && (getTargetRef().toString() != null)) {
      attributes.addAttribute("", "href", null, "xs:anyURI",
          getTargetRef().toString());
    }

    if (getDocumentations().isEmpty()) {
      writer.emptyElement(APP_NAMESPACE, "include", null, attributes);
    } else {
      writer.startElement(APP_NAMESPACE, "include", null, attributes);
      for (final DocumentationInfo documentationInfo : getDocumentations()) {
        documentationInfo.writeElement(writer);
      }
      writer.endElement(APP_NAMESPACE, "include");
    }
  }
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.atom

/**
 * Writes the representation to a XML writer.
 * 
 * @param writer
 *            The XML writer to write to.
 * @throws IOException
 */
@Override
public void write(XmlWriter writer) throws IOException {
  try {
    writer.forceNSDecl(APP_NAMESPACE, "");
    writer.forceNSDecl(ATOM_NAMESPACE, "atom");
    writer.setDataFormat(true);
    writer.setIndentStep(3);
    writer.startDocument();
    writer.startElement(APP_NAMESPACE, "service");
    for (final Workspace workspace : getWorkspaces()) {
      workspace.writeElement(writer);
    }
    writer.endElement(APP_NAMESPACE, "service");
    writer.endDocument();
  } catch (SAXException se) {
    throw new IOException("Couldn't write the service representation: "
        + se.getMessage());
  }
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @throws SAXException
 */
public void writeElement(XmlWriter writer) throws SAXException {
  if (getDocumentations().isEmpty() && getParameters().isEmpty()
      && getRepresentations().isEmpty()) {
    writer.emptyElement(APP_NAMESPACE, "request");
  } else {
    writer.startElement(APP_NAMESPACE, "request");
    for (final DocumentationInfo documentationInfo : getDocumentations()) {
      documentationInfo.writeElement(writer);
    }
    for (final ParameterInfo parameterInfo : getParameters()) {
      parameterInfo.writeElement(writer);
    }
    for (final RepresentationInfo representationInfo : getRepresentations()) {
      representationInfo.writeElement(writer);
    }
    writer.endElement(APP_NAMESPACE, "request");
  }
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.atom

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @throws SAXException
 */
public void writeElement(XmlWriter writer) throws SAXException {
  writer.startElement(APP_NAMESPACE, "workspace");
  if (getTitle() != null) {
    writer.dataElement(ATOM_NAMESPACE, "title", getTitle());
  }
  for (final Collection collection : getCollections()) {
    collection.writeElement(writer);
  }
  writer.endElement(APP_NAMESPACE, "workspace");
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.atom

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @throws SAXException
 */
public void writeElement(XmlWriter writer) throws SAXException {
  writer.startElement(APP_NAMESPACE, "workspace");
  if (getTitle() != null) {
    writer.dataElement(ATOM_NAMESPACE, "title", getTitle());
  }
  for (final Collection collection : getCollections()) {
    collection.writeElement(writer);
  }
  writer.endElement(APP_NAMESPACE, "workspace");
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.atom

/**
 * Writes the representation to a XML writer.
 * 
 * @param writer
 *            The XML writer to write to.
 * @throws IOException
 */
@Override
public void write(XmlWriter writer) throws IOException {
  try {
    writer.forceNSDecl(APP_NAMESPACE, "");
    writer.forceNSDecl(ATOM_NAMESPACE, "atom");
    writer.setDataFormat(true);
    writer.setIndentStep(3);
    writer.startDocument();
    writer.startElement(APP_NAMESPACE, "service");
    for (final Workspace workspace : getWorkspaces()) {
      workspace.writeElement(writer);
    }
    writer.endElement(APP_NAMESPACE, "service");
    writer.endDocument();
  } catch (SAXException se) {
    throw new IOException("Couldn't write the service representation: "
        + se.getMessage());
  }
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.atom

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @param localName
 *            The local name of the element.
 * @throws SAXException
 */
public void writeElement(XmlWriter writer, String localName)
    throws SAXException {
  writer.startElement(ATOM_NAMESPACE, localName);
  if (getEmail() != null) {
    writer.dataElement(ATOM_NAMESPACE, "email", getEmail());
  }
  if (getName() != null) {
    writer.dataElement(ATOM_NAMESPACE, "name", getName());
  }
  if ((getUri() != null) && (getUri().toString() != null)) {
    writer.dataElement(ATOM_NAMESPACE, "uri", getUri().toString());
  }
  writer.endElement(ATOM_NAMESPACE, localName);
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.atom

/**
 * Writes the current object as an XML element using the given SAX writer.
 * 
 * @param writer
 *            The SAX writer.
 * @param localName
 *            The local name of the element.
 * @throws SAXException
 */
public void writeElement(XmlWriter writer, String localName)
    throws SAXException {
  writer.startElement(ATOM_NAMESPACE, localName);
  if (getEmail() != null) {
    writer.dataElement(ATOM_NAMESPACE, "email", getEmail());
  }
  if (getName() != null) {
    writer.dataElement(ATOM_NAMESPACE, "name", getName());
  }
  if ((getUri() != null) && (getUri().toString() != null)) {
    writer.dataElement(ATOM_NAMESPACE, "uri", getUri().toString());
  }
  writer.endElement(ATOM_NAMESPACE, localName);
}

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