@Override public Set<Constraint> getConstraints() { Set<Constraint> constraints = new HashSet<Constraint>(); if (getSuperType() instanceof SimpleType) { SimpleType superType = (SimpleType) getSuperType(); constraints.addAll(superType.getConstraints()); } constraints.addAll(this.constraints); return Collections.unmodifiableSet(constraints); }
@Override public Type[] getTypeHierarchy() { Type type = getSuperType(); if (type == null) { return EMPTY_SUPERTYPES; } List<Type> types = new ArrayList<Type>(); while (type != null) { types.add(type); type = type.getSuperType(); } return types.toArray(new Type[types.size()]); }