/** * Check if class is a simple value type. * * @param clas * @return simple value type flag */ private boolean isSimpleValue(IClass clas) { return Types.isSimpleValue(clas.getName()); }
field = info.getField(m_fieldName); if (field == null) { throw new IllegalArgumentException("Field " + m_fieldName + " not found in class " + info.getName()); gmeth = info.getBestMethod(m_getName, null, Utility.EMPTY_STRING_ARRAY); if (gmeth == null) { throw new IllegalArgumentException("get method " + m_getName + " not found in class " + info.getName()); smeth = info.getBestMethod(m_setName, "void", null); if (smeth == null) { throw new IllegalArgumentException("gset method " + m_setName + " not found in class " + info.getName());
/** * Check if a class represents a simple value. TODO: implement ClassCustom hooks for this purpose * * @param type fully qualified class name * @return <code>true</code> if simple value, <code>false</code> if not */ public boolean isValueClass(String type) { ClassCustom clas = m_global.addClassCustomization(type); if (clas.isSimpleValue()) { m_formatSet.add(type); return true; } IClass sinfo = clas.getClassInformation().getSuperClass(); if (sinfo != null && "java.lang.Enum".equals(sinfo.getName())) { return true; } else { return false; } }
/** * Get the qualified name of the simple type used for a component, if a named simple type. If this returns * <code>null</code>, the {@link #buildSimpleType(IComponent)} method needs to be able to construct the * appropriate simple type definition. * * @param comp * @return qualified type name, <code>null</code> if inline definition needed */ private QName getSimpleTypeQName(IComponent comp) { IClass type = comp.getType(); String tname = comp.getType().getName(); QName qname = Types.schemaType(tname); if (qname == null) { qname = (QName)m_classSimpletypes.get(tname); if (qname == null) { ClassCustom custom = m_custom.getClassCustomization(type.getName()); if (custom != null && custom.isSimpleValue()) { qname = Types.STRING_QNAME; } else if (!type.isSuperclass("java.lang.Enum")) { m_context.addWarning("No schema equivalent known for type - treating as string", comp); qname = Types.STRING_QNAME; } } } return qname; }
EnumDetail detail = m_detailDirectory.getSimpleDetail(type.getName()); try { Class clas = type.loadClass();
/** * Add class-level documentation to a schema component. * * @param info class information (<code>null</code> if not available) * @param root */ private void addDocumentation(IClass info, AnnotatedBase root) { ClassCustom custom = m_custom.getClassCustomization(info.getName()); if (info != null && custom.isUseJavaDocs()) { List nodes = m_formatCache.getFormatter(custom).getClassDocumentation(info); if (nodes != null) { AnnotationElement anno = new AnnotationElement(); DocumentationElement doc = new DocumentationElement(); for (Iterator iter = nodes.iterator(); iter.hasNext();) { Node node = (Node)iter.next(); doc.addContent(node); } anno.getItemsList().add(doc); root.setAnnotation(anno); } } }
String stype = clas.getClassInformation().getSuperClass().getName(); if (!"java.lang.Object".equals(stype) && checkInclude(stype)) { include = true;
/** * Set the documentation for a schema component matching a class member. * * @param item * @param elem */ private void setDocumentation(IClassItem item, AnnotatedBase elem) { ClassCustom custom = m_custom.getClassCustomization(item.getOwningClass().getName()); if (custom != null && custom.isUseJavaDocs()) { List nodes = m_formatCache.getFormatter(custom).getItemDocumentation(item); if (nodes != null) { AnnotationElement anno = new AnnotationElement(); DocumentationElement doc = new DocumentationElement(); for (Iterator iter = nodes.iterator(); iter.hasNext();) { Node node = (Node)iter.next(); doc.addContent(node); } anno.getItemsList().add(doc); elem.setAnnotation(anno); } } }
String type = info.getName(); m_statedType = type; if (m_actualType == null) {
String stype = clas.getClassInformation().getSuperClass().getName(); if (!"java.lang.Object".equals(stype) && !Types.isSimpleValue(stype) && !isValueClass(stype) && !m_global.isKnownMapping(stype) && checkInclude(stype)) {
if (loc instanceof IClassSourceLocator) { IClassSourceLocator sloc = (IClassSourceLocator)loc; JavaClass jc = sloc.getSourceInfo(clas.getName()); if (jc != null) { if (isMethod()) {
String stype = sclas.getName(); Map exmethmap = Collections.EMPTY_MAP; if (checkInclude(stype)) {
ptype = parent.getName(); if (checkInclude(ptype)) { struct = new StructureElement();