IClassItem field = null; if (m_fieldName != null) { 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()); fillDetails(field, gmeth, smeth, info.getLocator(), req, style);
IClassItem[] fields = clas.getFields(); for (int i = 0; i < fields.length; i++) { IClassItem item = fields[i]; if (!Types.isSimpleValue(type)) { IClass info = icl.getRequiredClassInfo(type); if (info.isModifiable()) { m_fieldName = item.getName(); m_dataType = type; IClassItem field = clas.getField(m_fieldName); if (field == null) { throw new IllegalStateException("Field " + m_fieldName + " not found in exception class "
/** * Get formatted documentation from class, in the form of a list of <code>org.w3c.dom.Node</code> instances. * * @param info class information * @return formatted documentation (<code>null</code> if none) */ public List getClassDocumentation(IClass info) { return docToNodes(info.getJavaDoc()); }
/** * 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; }
if (sclas.isInterface() && !cust.isPropertyAccess()) { System.out.println("Warning: generating mapping for interface " + type + " without checking properties - consider setting property-access='true'"); while ((sclas = sclas.getSuperClass()) != null) { if (m_directSet.contains(sclas.getName())) { stype = sclas.getName(); isabs = Boolean.valueOf(sclas.isAbstract()); break; String[] intfs = sclas.getInterfaces(); for (int i = 0; i < intfs.length; i++) { String itype = intfs[i]; String[] sintfs = icust.getClassInformation().getInterfaces(); if (sintfs.length > 0) { itype = sintfs[0]; sclas = sclas.getSuperClass(); if (m_targetPackage == null && cust.getClassInformation().isModifiable()) { m_targetPackage = ((PackageCustom)cust.getParent()).getName();
if (clas.isAbstract() || clas.isInterface()) { mapcon.setAbstract(true); IClass parent = clas.getSuperClass(); if (cust.isUseSuper() && parent != null) { ptype = parent.getName(); if (checkInclude(ptype)) { struct = new StructureElement();
String base = uri = deriveNamespace(getParent().getNamespace(), m_classInformation.getPackage(), style); if (style == DERIVE_BY_PACKAGE) { uri = deriveServiceNamespace(base); m_documentation = fmt.docToNodes(m_classInformation.getJavaDoc()); s_logger.debug("Added operation " + op.getOperationName()); IClassItem[] methods = m_classInformation.getMethods(); for (int i = 0; i < methods.length; i++) { IClassItem method = methods[i];
IClass sclas = clas.getSuperClass(); String stype = sclas.getName(); Map exmethmap = Collections.EMPTY_MAP; if (checkInclude(stype)) { String[] intfs = sclas.getInterfaces(); for (int i = 0; i < intfs.length; i++) { String intf = intfs[i];
String type = info.getName(); m_statedType = type; if (m_actualType == null) { m_xmlName = getParent().convertName(m_baseName); m_collection = type.endsWith("[]") || info.isImplements("Ljava/util/Collection;"); m_primitive = ClassItem.isPrimitive(m_workingType);
m_checkedSource = true; IClass clas = getContainingClass(); IClassLocator loc = clas.getLocator(); if (loc instanceof IClassSourceLocator) { IClassSourceLocator sloc = (IClassSourceLocator)loc; JavaClass jc = sloc.getSourceInfo(clas.getName()); if (jc != null) { if (isMethod()) {
/** * 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()); }
IClassItem[] methods = m_classInformation.getMethods(); GlobalCustom global = getGlobal(); if (global.isOutput()) { IClassItem[] fields = m_classInformation.getFields(); Map fieldmap = mapFields(fields, getStripPrefixes(), getStripSuffixes(), inclset, exclset);
String stype = clas.getClassInformation().getSuperClass().getName(); if (!"java.lang.Object".equals(stype) && checkInclude(stype)) { include = true;
String stype = clas.getClassInformation().getSuperClass().getName(); if (!"java.lang.Object".equals(stype) && !Types.isSimpleValue(stype) && !isValueClass(stype) && !m_global.isKnownMapping(stype) && checkInclude(stype)) {
/** * 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); } } }
IClass info = locator.getClassInfo(service.getClassName()); if (info != null) { List nodes = m_generationParameters.getWsdlCustom().getFormatter(service).docToNodes(info.getJavaDoc()); def.setPortTypeDocumentation(nodes);
/** * 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); } } }