/** * Start a new element without a qname, attributes or a Namespace URI. * * <p> * This method will provide an empty string for the Namespace URI, and empty * string for the qualified name, and a default empty attribute list. It * invokes #startElement(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 start tag, or if a * restlet further down the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) */ public void startElement(String localName) throws SAXException { startElement("", localName, "", this.EMPTY_ATTS); }
/** * Start a new element without a qname, attributes or a Namespace URI. * * <p> * This method will provide an empty string for the Namespace URI, and empty * string for the qualified name, and a default empty attribute list. It * invokes #startElement(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 start tag, or if a * restlet further down the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) */ public void startElement(String localName) throws SAXException { startElement("", localName, "", this.EMPTY_ATTS); }
/** * Start a new element without a qname, attributes or a Namespace URI. * * <p> * This method will provide an empty string for the Namespace URI, and empty * string for the qualified name, and a default empty attribute list. It * invokes #startElement(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 start tag, or if a * restlet further down the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) */ public void startElement(String localName) throws SAXException { startElement("", localName, "", this.EMPTY_ATTS); }
/** * Start a new element without a qname or attributes. * * <p> * This method will provide a default empty attribute list and an empty * string for the qualified name. It invokes * {@link #startElement(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 start tag, or if a * restlet further down the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) */ public void startElement(String uri, String localName) throws SAXException { startElement(uri, localName, "", this.EMPTY_ATTS); }
/** * Start a new element without a qname or attributes. * * <p> * This method will provide a default empty attribute list and an empty * string for the qualified name. It invokes * {@link #startElement(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 start tag, or if a * restlet further down the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) */ public void startElement(String uri, String localName) throws SAXException { startElement(uri, localName, "", this.EMPTY_ATTS); }
/** * Start a new element without a qname or attributes. * * <p> * This method will provide a default empty attribute list and an empty * string for the qualified name. It invokes * {@link #startElement(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 start tag, or if a * restlet further down the filter chain raises an exception. * @see #startElement(String, String, String, Attributes) */ public void startElement(String uri, String localName) throws SAXException { startElement(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 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(); } }
/** * 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 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(); } }
/** * 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 ((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"); } } }
/** * 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"); } }
/** * 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()); } }
/** * 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"); }
/** * 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"); }
/** * 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()); } }
/** * 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); }
/** * 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); }