public StreamWriter startText(String name, Type type) { return startElement(name).writeAttribute("type", type != null ? type.name().toLowerCase() : "text"); }
public String getWrappedValue() { if (Type.XHTML.equals(type)) { return this.getFirstChildWithName(Constants.DIV).toString(); } else { return getValue(); } }
protected Text.Type getTextType() { Text.Type ttype = Text.Type.TEXT; String type = parser.getAttributeValue(null, LN_TYPE); if (type != null) { ttype = Text.Type.typeFromString(type); if (ttype == null) throw new FOMUnsupportedTextTypeException(type); } return ttype; }
Text text = (Text)element; Text.Type texttype = text.getTextType(); if (texttype.equals(Text.Type.TEXT) && !needToWriteLanguageFields(text)) { jstream.writeQuoted(text.getValue()); } else { jstream.writeField("attributes"); jstream.startObject(); jstream.writeField("type", texttype.name().toLowerCase()); writeLanguageFields(element, jstream); if (!isSameAsParentBase(element)) {
public Text setValue(String value) { complete(); if (value != null) { if (Type.TEXT.equals(type)) { setText(type, value); } else if (Type.HTML.equals(type)) { setText(type, value); } else if (Type.XHTML.equals(type)) { IRI baseUri = null; value = "<div xmlns=\"" + XHTML_NS + "\">" + value + "</div>"; Element element = null; try { baseUri = getResolvedBaseUri(); element = _parse(value, baseUri); } catch (Exception e) { } if (element != null && element instanceof Div) setValueElement((Div)element); } } else _removeAllChildren(); return this; }
public Text setWrappedValue(String wrappedValue) { complete(); if (Type.XHTML.equals(type)) { IRI baseUri = null; Element element = null; try { baseUri = getResolvedBaseUri(); element = _parse(wrappedValue, baseUri); } catch (Exception e) { } if (element != null && element instanceof Div) setValueElement((Div)element); } else { setValue(wrappedValue); } return this; }
@Override public IRI getBaseUri() { if (Type.XHTML.equals(type)) { Element el = getValueElement(); if (el != null) { if (el.getAttributeValue(BASE) != null) { if (getAttributeValue(BASE) != null) return super.getBaseUri().resolve(el.getAttributeValue(BASE)); else return _getUriValue(el.getAttributeValue(BASE)); } } } return super.getBaseUri(); }
public StreamWriter startText(String name, String namespace, Type type) { return startElement(name, namespace).writeAttribute("type", type != null ? type.name().toLowerCase() : "text"); }
public StreamWriter startText(QName qname, Text.Type type) { return startElement(qname).writeAttribute("type", type != null ? type.name().toLowerCase() : "text"); }
public StreamWriter startText( String name, Type type) { return startElement(name). writeAttribute("type",type!=null?type.name().toLowerCase():"text"); }
@Override public IRI getResolvedBaseUri() { if (Type.XHTML.equals(type)) { Element el = getValueElement(); if (el != null) { if (el.getAttributeValue(BASE) != null) { return super.getResolvedBaseUri().resolve(el.getAttributeValue(BASE)); } } } return super.getResolvedBaseUri(); }
public StreamWriter startText( String name, String namespace, Type type) { return startElement(name,namespace). writeAttribute("type",type!=null?type.name().toLowerCase():"text"); }
public StreamWriter startText( String name, String namespace, String prefix, Type type) { return startElement(name,namespace,prefix). writeAttribute("type",type!=null?type.name().toLowerCase():"text"); }
public String getValue() { String val = null; if (Type.TEXT.equals(type)) { val = getText(); } else if (Type.HTML.equals(type)) { val = getText(); } else if (Type.XHTML.equals(type)) { FOMDiv div = (FOMDiv)this.getFirstChildWithName(Constants.DIV); val = (div != null) ? div.getInternalValue() : null; } return val; }
public StreamWriter startText( QName qname, Text.Type type) { return startElement(qname). writeAttribute("type",type!=null?type.name().toLowerCase():"text"); }
@Override public String getLanguage() { if (Type.XHTML.equals(type)) { Element el = getValueElement(); if (el != null && el.getAttributeValue(LANG) != null) return el.getAttributeValue(LANG); } return super.getLanguage(); }
public StreamWriter startText(String name, String namespace, String prefix, Type type) { return startElement(name, namespace, prefix).writeAttribute("type", type != null ? type.name().toLowerCase() : "text"); }