use of com.ibm.xsp.registry.FacesContainerProperty in project org.openntf.nsfodp by OpenNTF.
the class AbstractSchemaServlet method outAnnotations.
private void outAnnotations(FacesDefinition def, FacesProperty prop, Element element) {
Document doc = element.getOwnerDocument();
Element annotation = doc.createElement("xs:annotation");
if (element.getFirstChild() != null) {
element.insertBefore(annotation, element.getFirstChild());
} else {
element.appendChild(annotation);
}
Element propElement = findDefinitionElement(def, prop);
{
Element appinfo = DOMUtil.createElement(doc, annotation, "xs:appinfo");
if (propElement != null) {
appinfo.setTextContent(propElement.getElementsByTagName("display-name").item(0).getTextContent());
} else {
appinfo.setTextContent(prop.getName());
}
}
{
Element documentation = DOMUtil.createElement(doc, annotation, "xs:documentation");
documentation.setAttribute("source", "version");
String since = prop.getSince();
if (StringUtil.isEmpty(since)) {
since = def.getSince();
if (StringUtil.isEmpty(since)) {
since = "8.5.0";
}
}
documentation.setTextContent(since + "+");
}
{
// This appears to be treated as HTML
Element documentation = DOMUtil.createElement(doc, annotation, "xs:documentation");
documentation.setAttribute("source", "description");
StringBuilder description = new StringBuilder();
if (propElement != null) {
p(description, propElement.getElementsByTagName("description").item(0).getTextContent());
description.append("<dl>");
try {
Object[] catNodes = DOMUtil.nodes(propElement, "property-extension/designer-extension/category/text()");
if (catNodes.length > 0) {
dt(description, "Property Group", ((Node) catNodes[0]).getTextContent());
}
} catch (XMLException e) {
throw new RuntimeException(e);
}
} else {
description.append("<dl>");
}
String className = prop.getJavaClass().getName();
if (prop instanceof FacesContainerProperty) {
FacesContainerProperty fcp = (FacesContainerProperty) prop;
if (fcp.isCollection()) {
className += "<" + fcp.getItemProperty().getJavaClass().getName() + ">";
}
}
dt(description, "Class", className);
// Expected to be opened in every if condition
description.append("</dl>");
documentation.setTextContent(description.toString());
}
}
Aggregations