public void setContent(TextConstruct tc) { state.content = new TextContent(tc); }
public void setContent(TextConstruct tc) { state.content = new TextContent(tc); }
public void setContent(TextConstruct tc) { state.content = new TextContent(tc); }
@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; }
/** * Assumes the content element's contents are text and * returns them as a TextContent. * * @return A TextContent containing the value of the content tag. * * @throws IllegalStateException * If the content element is not a text type. */ public TextContent getTextContent() { Content content = getContent(); if(content == null){ content = new TextContent(new PlainTextConstruct()); } if (!(content instanceof TextContent)) { throw new IllegalStateException("Content object is not a TextContent : " + content); } return (TextContent) content; }
type.equals("xhtml")) { TextContent tc = new TextContent(); TextConstruct.ChildHandlerInfo chi = TextConstruct.getChildHandler(attrs);
type.equals("xhtml")) { TextContent tc = new TextContent(); TextConstruct.ChildHandlerInfo chi = TextConstruct.getChildHandler(attrs);
type.equals("xhtml")) { TextContent tc = new TextContent(); TextConstruct.ChildHandlerInfo chi = TextConstruct.getChildHandler(attrs);