/** * Sets the value using a textual DIV (or simple text block which will be * converted to XHTML) */ public void setDiv(String theTextDiv) { myDiv = new XhtmlDt(theTextDiv); }
@Override public String getDivAsString() { return getDiv().getValueAsString(); }
public boolean hasContent() { return isNotBlank(getValue()); }
if (dt.hasContent()) { encodeXhtml(dt, theEventWriter); if (!dt.isEmpty()) { XhtmlDt hdt = new XhtmlDt(); hdt.setValueAsString(dt.getValueAsString()); encodeXhtml(hdt, theEventWriter);
/** * Accepts a textual DIV and parses it into XHTML events which are stored internally. * <p> * <b>Formatting note:</b> The text will be trimmed {@link String#trim()}. If the text does not start with an HTML tag (generally this would be a div tag), a div tag will be automatically placed * surrounding the text. * </p> * <p> * Also note that if the parsed text contains any entities (&foo;) which are not a part of the entities defined in core XML (e.g. &sect; which is valid in XHTML 1.0 but not in XML 1.0) they * will be parsed and converted to their equivalent unicode character. * </p> */ @Override public void setValueAsString(String theValue) throws DataFormatException { if (theValue == null || theValue.isEmpty()) { super.setValueAsString(null); } else { String value = theValue.trim(); value = preprocessXhtmlNamespaceDeclaration(value); super.setValueAsString(value); } }
@Override public void setDivAsString(String theString) { getDiv().setValueAsString(theString); }
if (dt.hasContent()) { encodeXhtml(dt, theEventWriter); if (!dt.isEmpty()) { XhtmlDt hdt = new XhtmlDt(); hdt.setValueAsString(dt.getValueAsString()); encodeXhtml(hdt, theEventWriter);
val = XhtmlDt.preprocessXhtmlNamespaceDeclaration(val);
/** * Constructor which accepts a string code * * @see #setValueAsString(String) for a description of how this value is applied */ @SimpleSetter() public XhtmlDt(@SimpleSetter.Parameter(name = "theTextDiv") String theTextDiv) { setValueAsString(theTextDiv); }
/** * Gets the value(s) for <b>div</b> (Limited xhtml content). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * The actual narrative content, a stripped down version of XHTML * </p> */ public XhtmlDt getDiv() { if (myDiv == null) { myDiv = new XhtmlDt(); } return myDiv; }
@Override public String getDivAsString() { return getDiv().getValueAsString(); }
@Override public String getValueAsString() { if (isEmpty()) { return null; } try { String retVal = new XhtmlComposer(XhtmlComposer.HTML).compose(this); retVal = XhtmlDt.preprocessXhtmlNamespaceDeclaration(retVal); return retVal; } catch (Exception e) { // TODO: composer shouldn't throw exception like this throw new RuntimeException(e); } }
((IResource) input).getText().getDiv().setValueAsString((String) null); ((IResource) input).getText().getStatus().setValueAsString((String) null); if (input instanceof Bundle) { for (Entry nextEntry : ((Bundle) input).getEntry()) { if (nextEntry.getResource() != null) { nextEntry.getResource().getText().getDiv().setValueAsString((String) null); nextEntry.getResource().getText().getStatus().setValueAsString((String) null);
/** * Sets the value using a textual DIV (or simple text block which will be * converted to XHTML) */ public void setDiv(String theTextDiv) { myDiv = new XhtmlDt(theTextDiv); }
writer.append(((IResource) theResource).getText().getDiv().getValueAsString()); } else if (encodingDomainResourceAsText && theResource instanceof IDomainResource) {
/** * Accepts a textual DIV and parses it into XHTML events which are stored internally. * <p> * <b>Formatting note:</b> The text will be trimmed {@link String#trim()}. If the text does not start with an HTML tag (generally this would be a div tag), a div tag will be automatically placed * surrounding the text. * </p> * <p> * Also note that if the parsed text contains any entities (&foo;) which are not a part of the entities defined in core XML (e.g. &sect; which is valid in XHTML 1.0 but not in XML 1.0) they * will be parsed and converted to their equivalent unicode character. * </p> */ @Override public void setValueAsString(String theValue) throws DataFormatException { if (theValue == null || theValue.isEmpty()) { super.setValueAsString(null); } else { String value = theValue.trim(); value = preprocessXhtmlNamespaceDeclaration(value); super.setValueAsString(value); } }
@Override public void setDivAsString(String theString) { getDiv().setValueAsString(theString); }
/** * Sets the value using a textual DIV (or simple text block which will be * converted to XHTML) */ public void setDiv(String theTextDiv) { myDiv = new XhtmlDt(theTextDiv); }