/** * Add an empty element without a Namespace URI, qname or attributes. * * <p> * This method will supply an empty string for the qname, and empty string * for the Namespace URI, and an empty attribute list. It invokes * {@link #emptyElement(String, String, String, Attributes)} directly. * </p> * * @param localName * The element's local name. * @exception org.xml.sax.SAXException * If there is an error writing the empty tag, or if a * restlet further down the filter chain raises an exception. * @see #emptyElement(String, String, String, Attributes) */ public void emptyElement(String localName) throws SAXException { emptyElement("", localName, "", this.EMPTY_ATTS); }
/** * Add an empty element without a qname or attributes. * * <p> * This method will supply an empty string for the qname and an empty * attribute list. It invokes * {@link #emptyElement(String, String, String, Attributes)} 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 empty tag, or if a * restlet further down the filter chain raises an exception. * @see #emptyElement(String, String, String, Attributes) */ public void emptyElement(String uri, String localName) throws SAXException { emptyElement(uri, localName, "", this.EMPTY_ATTS); }
/** * Add an empty element without a Namespace URI, qname or attributes. * * <p> * This method will supply an empty string for the qname, and empty string * for the Namespace URI, and an empty attribute list. It invokes * {@link #emptyElement(String, String, String, Attributes)} directly. * </p> * * @param localName * The element's local name. * @exception org.xml.sax.SAXException * If there is an error writing the empty tag, or if a * restlet further down the filter chain raises an exception. * @see #emptyElement(String, String, String, Attributes) */ public void emptyElement(String localName) throws SAXException { emptyElement("", localName, "", this.EMPTY_ATTS); }
/** * Add an empty element without a Namespace URI, qname or attributes. * * <p> * This method will supply an empty string for the qname, and empty string * for the Namespace URI, and an empty attribute list. It invokes * {@link #emptyElement(String, String, String, Attributes)} directly. * </p> * * @param localName * The element's local name. * @exception org.xml.sax.SAXException * If there is an error writing the empty tag, or if a * restlet further down the filter chain raises an exception. * @see #emptyElement(String, String, String, Attributes) */ public void emptyElement(String localName) throws SAXException { emptyElement("", localName, "", this.EMPTY_ATTS); }
/** * Add an empty element without a qname or attributes. * * <p> * This method will supply an empty string for the qname and an empty * attribute list. It invokes * {@link #emptyElement(String, String, String, Attributes)} 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 empty tag, or if a * restlet further down the filter chain raises an exception. * @see #emptyElement(String, String, String, Attributes) */ public void emptyElement(String uri, String localName) throws SAXException { emptyElement(uri, localName, "", this.EMPTY_ATTS); }
/** * Add an empty element without a qname or attributes. * * <p> * This method will supply an empty string for the qname and an empty * attribute list. It invokes * {@link #emptyElement(String, String, String, Attributes)} 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 empty tag, or if a * restlet further down the filter chain raises an exception. * @see #emptyElement(String, String, String, Attributes) */ public void emptyElement(String uri, String localName) throws SAXException { emptyElement(uri, localName, "", this.EMPTY_ATTS); }
/** * 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); } }
/** * 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); } }
/** * 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 (getLabel() != null) { attributes.addAttribute("", "label", null, "text", getLabel()); } if ((getScheme() != null) && (getScheme().toString() != null)) { attributes.addAttribute("", "scheme", null, "atomURI", getScheme() .toString()); } if (getTerm() != null) { attributes.addAttribute("", "term", null, "text", getTerm()); } writer.emptyElement(ATOM_NAMESPACE, "category", null, attributes); }
/** * 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"); } }
/** * 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 (getLabel() != null) { attributes.addAttribute("", "label", null, "text", getLabel()); } if ((getScheme() != null) && (getScheme().toString() != null)) { attributes.addAttribute("", "scheme", null, "atomURI", getScheme() .toString()); } if (getTerm() != null) { attributes.addAttribute("", "term", null, "text", getTerm()); } writer.emptyElement(ATOM_NAMESPACE, "category", null, attributes); }
/** * 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"); } }
/** * 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 ((getUri() != null) && (getUri().toString() != null)) { attributes.addAttribute("", "uri", null, "atomURI", getUri() .toString()); } if (getVersion() != null) { attributes.addAttribute("", "version", null, "text", getVersion()); } if (getName() != null) { writer.dataElement(ATOM_NAMESPACE, "generator", null, attributes, getName()); } else { writer.emptyElement(ATOM_NAMESPACE, "generator", null, attributes); } }
/** * 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 ((getUri() != null) && (getUri().toString() != null)) { attributes.addAttribute("", "uri", null, "atomURI", getUri() .toString()); } if (getVersion() != null) { attributes.addAttribute("", "version", null, "text", getVersion()); } if (getName() != null) { writer.dataElement(ATOM_NAMESPACE, "generator", null, attributes, getName()); } else { writer.emptyElement(ATOM_NAMESPACE, "generator", null, attributes); } }
/** * 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"); } } }
getContent()); } else { writer.emptyElement(ATOM_NAMESPACE, localName, null, attributes);
getContent()); } else { writer.emptyElement(ATOM_NAMESPACE, localName, null, attributes);
/** * 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 (getBaseRef() != null) { attributes.addAttribute("", "base", null, "xs:anyURI", getBaseRef() .toString()); } if (getDocumentations().isEmpty() && getResources().isEmpty()) { writer.emptyElement(APP_NAMESPACE, "resources", null, attributes); } else { writer.startElement(APP_NAMESPACE, "resources", null, attributes); for (final DocumentationInfo documentationInfo : getDocumentations()) { documentationInfo.writeElement(writer); } for (final ResourceInfo resourceInfo : getResources()) { resourceInfo.writeElement(writer); } writer.endElement(APP_NAMESPACE, "resources"); } }
writer.emptyElement(APP_NAMESPACE, "resource_type", null, attributes); } else {
/** * 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"); } }