static SimpleType[] getSimpleTypes(XSIElementHandler child, SchemaHandler parent) { switch (child.getHandlerType()) { case RESTRICTION: return getSimpleTypes((RestrictionHandler) child, parent); case LIST: return getSimpleTypes((ListHandler) child, parent); case UNION: return getSimpleTypes((UnionHandler) child, parent); default: throw new RuntimeException( "Should not be here ... child is one of the other three types."); } }
/** * compacts the data resolving references. * * @param parent */ protected SimpleType compress(SchemaHandler parent) { logger.info("Start compressing SimpleType " + getName()); if (cache != null) { return cache; } Facet[] facets = null; if (child.getHandlerType() == SimpleType.RESTRICTION) { facets = getFacets((RestrictionHandler) child); } SimpleType[] simpleTypes = getSimpleTypes(child, parent); cache = new SimpleTypeGT( id, name, parent.getTargetNamespace(), child.getHandlerType(), simpleTypes, facets, finaL); logger.info("End compressing SimpleType " + getName()); id = null; child = null; return cache; }