/** * Check if class is an enumeration type. * * @param clas * @return enumeration type flag */ private boolean isEnumeration(IClass clas) { return clas.isSuperclass("java.lang.Enum"); }
String stype = smeth.getArgumentType(0); IClass gclas = icl.getRequiredClassInfo(gtype); if (gclas.isSuperclass(stype) || gclas.isImplements(stype)) { type = gtype; } else {
/** * 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; }