/** @return the XHTML contents of this text construct */ public XmlBlob getXhtml() { if (xhtml == null) { xhtml = new XmlBlob(); // init on demand } return xhtml; } /** Specifies the XHTML contents of this text construct. */
/** @return the XHTML contents of this text construct */ public XmlBlob getXhtml() { if (xhtml == null) { xhtml = new XmlBlob(); // init on demand } return xhtml; } /** Specifies the XHTML contents of this text construct. */
/** @return the XHTML contents of this text construct */ public XmlBlob getXhtml() { if (xhtml == null) { xhtml = new XmlBlob(); // init on demand } return xhtml; } /** Specifies the XHTML contents of this text construct. */
/** * Class constructor. * * @throws IOException */ public AtomHandler() throws IOException { xhtml = new XmlBlob(); initializeXmlBlob(xhtml, true, true); lang = xmlLang; }
/** * Class constructor. * * @throws IOException */ public AtomHandler() throws IOException { xhtml = new XmlBlob(); initializeXmlBlob(xhtml, true, true); lang = xmlLang; }
/** * Class constructor. * * @throws IOException */ public AtomHandler() throws IOException { xhtml = new XmlBlob(); initializeXmlBlob(xhtml, true, true); lang = xmlLang; }
/** * Class constructor specifying attributes. * * @throws IOException */ AtomHandler(ExtensionProfile extProfile, Attributes attrs) throws IOException { this.extProfile = extProfile; String typeAttr = attrs.getValue("", "type"); if ("application/atom+xml;type=feed".equals(typeAttr)) { ext = new Feed(); type = Content.Type.OTHER_XML; } else if ("application/atom+xml;type=entry".equals(typeAttr)) { type = Content.Type.OTHER_XML; ext = new Entry(); } else if (typeAttr.endsWith("+xml") || typeAttr.endsWith("/xml")) { type = Content.Type.OTHER_XML; xml = new XmlBlob(); initializeXmlBlob(xml, true, true); } else if (typeAttr.startsWith("text/")) { type = Content.Type.OTHER_TEXT; } else { type = Content.Type.OTHER_BINARY; } }
/** * Class constructor specifying attributes. * * @throws IOException */ AtomHandler(ExtensionProfile extProfile, Attributes attrs) throws IOException { this.extProfile = extProfile; String typeAttr = attrs.getValue("", "type"); if ("application/atom+xml;type=feed".equals(typeAttr)) { ext = new Feed(); type = Content.Type.OTHER_XML; } else if ("application/atom+xml;type=entry".equals(typeAttr)) { type = Content.Type.OTHER_XML; ext = new Entry(); } else if (typeAttr.endsWith("+xml") || typeAttr.endsWith("/xml")) { type = Content.Type.OTHER_XML; xml = new XmlBlob(); initializeXmlBlob(xml, true, true); } else if (typeAttr.startsWith("text/")) { type = Content.Type.OTHER_TEXT; } else { type = Content.Type.OTHER_BINARY; } }
/** * Class constructor specifying attributes. * * @throws IOException */ AtomHandler(ExtensionProfile extProfile, Attributes attrs) throws IOException { this.extProfile = extProfile; String typeAttr = attrs.getValue("", "type"); if ("application/atom+xml;type=feed".equals(typeAttr)) { ext = new Feed(); type = Content.Type.OTHER_XML; } else if ("application/atom+xml;type=entry".equals(typeAttr)) { type = Content.Type.OTHER_XML; ext = new Entry(); } else if (typeAttr.endsWith("+xml") || typeAttr.endsWith("/xml")) { type = Content.Type.OTHER_XML; xml = new XmlBlob(); initializeXmlBlob(xml, true, true); } else if (typeAttr.startsWith("text/")) { type = Content.Type.OTHER_TEXT; } else { type = Content.Type.OTHER_BINARY; } }
@Override public Content parseContent(Element element) { checkNotNull(element); String href = element.getAttribute("href"); if (href.equals("")) { StringBuilder builder = new StringBuilder(); NodeList nodeList = element.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node child = nodeList.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { builder.append(xmlElementOf((Element) child)); } else if (child.getNodeType() == Node.TEXT_NODE) { builder.append(child.getNodeValue()); } } XmlBlob xmlBlob = new XmlBlob(); xmlBlob.setBlob(builder.toString()); TextContent content = new TextContent(); content.setContent(new XhtmlTextConstruct(xmlBlob)); return content; } OutOfLineContent content = new OutOfLineContent(); content.setUri(href); return content; }
/** * Sets the content of the given entry to the given String. */ public static void setContent(BaseContentEntry<?> entry, String content) { XmlBlob blob = new XmlBlob(); blob.setBlob(content); TextConstruct textConstruct = new XhtmlTextConstruct(blob); entry.setContent(textConstruct); }
index = content.indexOf(prefix + "../"); XmlBlob blob = new XmlBlob(); blob.setBlob(content); TextConstruct textConstruct = new XhtmlTextConstruct(blob);
/** * Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This * operation overwrites the current contents of this extension point. */ public void parseCumulativeXmlBlob(XmlBlob blob, ExtensionProfile extProfile, Class<? extends ExtensionPoint> extendedClass) throws IOException, ParseException { this.xmlBlob = new XmlBlob(); nonRepeatingExtensionMap.clear(); repeatingExtensionMap.clear(); // Prepare a fake XML document from the blob. StringWriter sw = new StringWriter(); XmlWriter w = new XmlWriter(sw); XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null); XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob); // Now parse it. StringReader sr = new StringReader(sw.toString()); XmlParser parser = new XmlParser(); parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "", "CUMULATIVE_BLOB"); }
/** * Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This * operation overwrites the current contents of this extension point. */ public void parseCumulativeXmlBlob(XmlBlob blob, ExtensionProfile extProfile, Class<? extends ExtensionPoint> extendedClass) throws IOException, ParseException { this.xmlBlob = new XmlBlob(); nonRepeatingExtensionMap.clear(); repeatingExtensionMap.clear(); // Prepare a fake XML document from the blob. StringWriter sw = new StringWriter(); XmlWriter w = new XmlWriter(sw); XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null); XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob); // Now parse it. StringReader sr = new StringReader(sw.toString()); XmlParser parser = new XmlParser(); parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "", "CUMULATIVE_BLOB"); }
/** * Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This * operation overwrites the current contents of this extension point. */ public void parseCumulativeXmlBlob(XmlBlob blob, ExtensionProfile extProfile, Class<? extends ExtensionPoint> extendedClass) throws IOException, ParseException { this.xmlBlob = new XmlBlob(); nonRepeatingExtensionMap.clear(); repeatingExtensionMap.clear(); // Prepare a fake XML document from the blob. StringWriter sw = new StringWriter(); XmlWriter w = new XmlWriter(sw); XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null); XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob); // Now parse it. StringReader sr = new StringReader(sw.toString()); XmlParser parser = new XmlParser(); parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "", "CUMULATIVE_BLOB"); }
XmlBlob xmlBlob = new XmlBlob(); xmlBlob.setBlob(infoElement.toString()); extendedProperty.setXmlBlob(xmlBlob);
throws IOException { XmlBlob cumulative = new XmlBlob(); Collection<XmlNamespace> namespaces = cumulative.getNamespaces();
throws IOException { XmlBlob cumulative = new XmlBlob(); Collection<XmlNamespace> namespaces = cumulative.getNamespaces();
throws IOException { XmlBlob cumulative = new XmlBlob(); Collection<XmlNamespace> namespaces = cumulative.getNamespaces();