public void setContent(TextConstruct tc) { state.content = new TextContent(tc); }
/** * Assumes the <content> element's contents are plain-text and * returns its value as a string * * @return A string containing the plain-text value of the content tag. * * @throws IllegalStateException * If the content element is not a text type. */ public String getPlainTextContent() { TextConstruct textConstruct = getTextContent().getContent(); if (!(textConstruct instanceof PlainTextConstruct)) { throw new IllegalStateException( "TextConstruct object is not a PlainTextConstruct"); } return textConstruct.getPlainText(); }
@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 plain-text and * returns its value as a string * * @return A string containing the plain-text value of the content tag. * * @throws IllegalStateException * If the content element is not a text type. */ public String getPlainTextContent() { TextConstruct textConstruct = getTextContent().getContent(); if (!(textConstruct instanceof PlainTextConstruct)) { throw new IllegalStateException( "TextConstruct object is not a PlainTextConstruct"); } return textConstruct.getPlainText(); }
type.equals("xhtml")) { TextContent tc = new TextContent(); TextConstruct.ChildHandlerInfo chi = TextConstruct.getChildHandler(attrs); tc.setContent(chi.textConstruct); childHandlerInfo.handler = chi.handler; childHandlerInfo.content = tc;
/** * Assumes the <content> element's contents are plain-text and * returns its value as a string * * @return A string containing the plain-text value of the content tag. * * @throws IllegalStateException * If the content element is not a text type. */ public String getPlainTextContent() { TextConstruct textConstruct = getTextContent().getContent(); if (!(textConstruct instanceof PlainTextConstruct)) { throw new IllegalStateException( "TextConstruct object is not a PlainTextConstruct"); } return textConstruct.getPlainText(); }
type.equals("xhtml")) { TextContent tc = new TextContent(); TextConstruct.ChildHandlerInfo chi = TextConstruct.getChildHandler(attrs); tc.setContent(chi.textConstruct); childHandlerInfo.handler = chi.handler; childHandlerInfo.content = tc;
public void setContent(TextConstruct tc) { state.content = new TextContent(tc); }
try { String content = ((XhtmlTextConstruct)(entry.getTextContent() .getContent())).getXhtml().getBlob();
type.equals("xhtml")) { TextContent tc = new TextContent(); TextConstruct.ChildHandlerInfo chi = TextConstruct.getChildHandler(attrs); tc.setContent(chi.textConstruct); childHandlerInfo.handler = chi.handler; childHandlerInfo.content = tc;
public void setContent(TextConstruct tc) { state.content = new TextContent(tc); }
/** * Returns the comment of the complaint. * * @return the comment of the complaint */ public String getComment() { if (getContent() instanceof TextContent) { return ((TextContent) getContent()).getContent().getPlainText(); } return null; }
/** * 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; }
/** * Returns the comment of the complaint. * * @return the comment of the complaint */ public String getComment() { if (getContent() instanceof TextContent) { return ((TextContent) getContent()).getContent().getPlainText(); } return null; }
.getEntries(query, sitesService); for (BaseContentEntry<?> entry : entries) { String otherContent = entry.getTextContent().getContent().getPlainText(); if (otherContent.equals(content)) { return true;
/** * Positive test case for RetrieveSingleContactGroup method with mandatory parameters. */ @Test(priority = 2, groups = { "wso2.esb" }, dependsOnMethods = { "testCreateContactGroupWithMandatoryParameters" }, description = "Google Contacts {retrieveSingleContactGroup integration test with mandatory parameters.") public void testRetrieveSingleContactGroup() throws Exception { Map<String, String> parametersMap = new HashMap<String, String>(); parametersMap.put("groupId", groupId); SOAPEnvelope esbSoapResponse = sendSOAPRequest(proxyUrl, "esb_retrieveSingleContactGroup_mandatory.xml", parametersMap); ContactGroupEntry directResponse = (ContactGroupEntry) directInvoker.retrieveSingleContactGroup(groupId); // Assert id Assert.assertEquals((String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//atom:id/text())", nameSpaceMap), directResponse.getId()); // Assert title Assert.assertEquals((String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//atom:title/text())", nameSpaceMap), directResponse.getTitle().getPlainText()); // Assert content Assert.assertEquals((String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//atom:content/text())", nameSpaceMap), ((TextContent) directResponse.getContent()).getContent().getPlainText()); }
public GSpreadResultSet retrieveData() throws Exception { URL worksheetUrl = this.getConfig().generateWorksheetFeedURL(); WorksheetFeed feedw = this.getConfig().getFeed(worksheetUrl, WorksheetFeed.class); WorksheetEntry worksheetEntry = feedw.getEntries().get(this.getWorksheetNumber() - 1); CellFeed feedc = this.getConfig().getFeed(worksheetEntry.getCellFeedUrl(), CellFeed.class); List<CellEntry> entries = feedc.getEntries(); GSpreadResultSet grs = new GSpreadResultSet(); /* store the data */ for (CellEntry entry : entries) { grs.addCell(this.getPosStringFromId(entry.getId()), entry.getTextContent().getContent().getPlainText()); } return grs; }