/** * Retrieve the details for a TextConstruct object. * * @param data The text construct object to display. * * @return Either 'Not defined' if the data is <code>null</code>, or * details of the text content element. */ private String getTextConstructDetails(TextConstruct data) { String summaryStr = ""; if (data == null) { summaryStr = "Not defined"; } else { summaryStr = "Content: '" + data.getContent() + "', Type: "; if (data.getType() != null) { summaryStr += "'" + data.getType().toString() + "'"; } else { summaryStr += "undefined."; } } return summaryStr; }
/** * Retrieve the details for a TextConstruct object. * * @param data The text construct object to display. * * @return Either 'Not defined' if the data is <code>null</code>, or * details of the text content element. */ private String getTextConstructDetails(TextConstruct data) { String summaryStr = ""; if( data == null ) { summaryStr = "Not defined"; } else { summaryStr = "Content: '" + data.getContent() + "', Type: "; if( data.getType() != null ) { summaryStr += "'" + data.getType().toString() + "'"; } else { summaryStr += "undefined."; } } return summaryStr; }
/** * Retrieve the details for a TextConstruct object. * * @param data The text construct object to display. * * @return Either 'Not defined' if the data is <code>null</code>, or * details of the text content element. */ private String getTextConstructDetails(TextConstruct data) { String summaryStr = ""; if( data == null ) { summaryStr = "Not defined"; } else { summaryStr = "Content: '" + data.getContent() + "', Type: "; if( data.getType() != null ) { summaryStr += "'" + data.getType().toString() + "'"; } else { summaryStr += "undefined."; } } return summaryStr; }
/** * Marshal the data in this object to an Element object. * * @return The data expressed in an Element. */ public Element marshall() { Element element = new Element(getQualifiedName(), Namespaces.NS_ATOM); if (type != null) { Attribute typeAttribute = new Attribute(ATTRIBUTE_TYPE, type.toString()); element.addAttribute(typeAttribute); } if (content != null) { element.appendChild(content); } return element; }
System.out.print("Title: " + title.getContent() + " type: "); if (title.getType() != null) { System.out.println(title.getType().toString()); } else { System.out.println("Not specified.");
if( title.getType() != null ) System.out.println(title.getType().toString());
/** * Marshal the data in this object to an Element object. * * @return The data expressed in an Element. */ public Element marshall() { Element element = new Element(getQualifiedName(), Namespaces.NS_ATOM); if( type != null ) { Attribute typeAttribute = new Attribute(ATTRIBUTE_TYPE, type.toString()); element.addAttribute(typeAttribute); } if( content != null ) { element.appendChild(content); } return element; }
/** * Marshall the data in this object to an Element object. * * @return The data expressed in an Element. */ public Element marshall() { Element element = new Element(getQualifiedName(), Namespaces.NS_ATOM); if( type != null ) { Attribute typeAttribute = new Attribute(ATTRIBUTE_TYPE, type.toString()); element.addAttribute(typeAttribute); } if( content != null ) { element.appendChild(content); } return element; }
boolean success = true; String value = attribute.getValue(); if (ContentType.TEXT.toString().equals(value)) { type = ContentType.TEXT; } else if (ContentType.HTML.toString().equals(value)) { type = ContentType.HTML; } else if (ContentType.XHTML.toString().equals(value)) { type = ContentType.XHTML; } else { info.setContentDescription(type.toString()); attributeItems.add(info);
if( title.getType() != null ) System.out.println(title.getType().toString());
/** * @param existing add results to this. * @param attributeItems add these too. * @param validationContext FIXME: PLEASE DOCUMENT. * @return SWORD validation info */ protected SwordValidationInfo validate(List<SwordValidationInfo> existing, List<SwordValidationInfo> attributeItems, Properties validationContext) { boolean validateAll = (existing == null); SwordValidationInfo result = new SwordValidationInfo(xmlName); result.setContentDescription(content); // item specific rules if (content == null) { result.addValidationInfo( new SwordValidationInfo(xmlName, "Missing content for element", SwordValidationInfoType.WARNING)); } if (validateAll) { SwordValidationInfo info = new SwordValidationInfo(xmlName, new XmlName(xmlName.getPrefix(), ATTRIBUTE_TYPE, xmlName.getNamespace())); info.setContentDescription(type.toString()); result.addAttributeValidationInfo(info); } result.addUnmarshallValidationInfo(existing, attributeItems); return result; }
info.setContentDescription(type.toString()); result.addAttributeValidationInfo(info);
info.setContentDescription(type.toString()); result.addAttributeValidationInfo(info);