/** * Determines if <code>parent</code> is a super type of <code>type</code> * * @param type The type in question. * @param parent The possible parent type. */ public static boolean isSuperType(PropertyType type, PropertyType parent) { while (type.getSuper() != null) { type = type.getSuper(); if (type.equals(parent)) return true; } return false; }
/** * Return true if the type is either a simple type or has a simple type as its supertype. In * particular, complex types with simple content will return true. * * @param type * @return */ public static boolean isSimpleContentType(PropertyType type) { if (type == XSSchema.ANYSIMPLETYPE_TYPE) { // should never happen as this type is abstract throw new RuntimeException("Unexpected simple type"); } PropertyType superType = type.getSuper(); if (superType == XSSchema.ANYSIMPLETYPE_TYPE) { return true; } else if (superType == null) { return false; } else { return isSimpleContentType(superType); } }
return true; PropertyType superType = type.getSuper(); if (superType == XSSchema.ANYTYPE_TYPE) {
/** * Determines if <code>parent</code> is a super type of <code>type</code> * * @param type * The type in question. * @param parent * The possible parent type. * */ public static boolean isSuperType(PropertyType type, PropertyType parent) { while (type.getSuper() != null) { type = type.getSuper(); if (type.equals(parent)) return true; } return false; }
public boolean equals(Object other) { if (this == other) return true; if (!(other instanceof PropertyType)) { return false; } PropertyType prop = (PropertyType) other; if (!Utilities.equals(name, prop.getName())) { return false; } if (!Utilities.equals(binding, prop.getBinding())) { return false; } if (isAbstract != prop.isAbstract()) { return false; } if (!equals(getRestrictions(), prop.getRestrictions())) { return false; } if (!Utilities.equals(superType, prop.getSuper())) { return false; } if (!Utilities.equals(description, prop.getDescription())) { return false; } return true; }
type = type.getSuper();
/** * Return true if the type is either a simple type or has a simple type as its supertype. In * particular, complex types with simple content will return true. * * @param type * @return */ public static boolean isSimpleContentType(PropertyType type) { if (type == XSSchema.ANYSIMPLETYPE_TYPE) { // should never happen as this type is abstract throw new RuntimeException("Unexpected simple type"); } PropertyType superType = type.getSuper(); if (superType == XSSchema.ANYSIMPLETYPE_TYPE) { return true; } else if (superType == null) { return false; } else { return isSimpleContentType(superType); } }
/** * Return true if the type is either a simple type or has a simple type as its supertype. In * particular, complex types with simple content will return true. * * @param type * @return */ public static boolean isSimpleContentType(PropertyType type) { if (type == XSSchema.ANYSIMPLETYPE_TYPE) { // should never happen as this type is abstract throw new RuntimeException("Unexpected simple type"); } PropertyType superType = type.getSuper(); if (superType == XSSchema.ANYSIMPLETYPE_TYPE) { return true; } else if (superType == null) { return false; } else { return isSimpleContentType(superType); } } }
return true; PropertyType superType = type.getSuper(); if (superType == XSSchema.ANYTYPE_TYPE) {
if (!Utilities.equals(superType, prop.getSuper())) { return false;
type = type.getSuper();