public AttributeType getSuper() { return getSubject().getSuper(); }
/** * Get base (non-collection) type of simple content. * * @param type * @return */ static AttributeType getSimpleContentType(AttributeType type) { Class<?> binding = type.getBinding(); if (binding == Collection.class) { return getSimpleContentType(type.getSuper()); } else { return type; } }
/** * Get base (non-collection) type of simple content. * * @param type * @return */ static AttributeType getSimpleContentType(AttributeType type) { Class<?> binding = type.getBinding(); if (binding == Collection.class) { return getSimpleContentType(type.getSuper()); } else { return type; } }
/** * We can only restrict node if the restricftion is a subtype that used by node. * * @param node * @param restrict * @return restrict, iff restrict.getType() ISA node.getType() */ AttributeDescriptor restrict(AttributeDescriptor node, AttributeDescriptor restrict) { if (node.getType() == restrict.getType()) { return restrict; } for (AttributeType /* <?> */ type = restrict.getType(); type != null; type = type.getSuper()) { if (node.getType().equals(type)) { return restrict; } } throw new IllegalArgumentException("Cannot restrict provided schema"); }
/** * Complete the definition of a type and store it in the schema. * * <p>This method calls {@link AttributeType#getSuper()} (and {@link * ComplexType#getDescriptors()} where applicable) to ensure the construction of the type (a * concrete {@link AbstractLazyAttributeTypeImpl} or {@link AbstractLazyComplexTypeImpl} * sublass) is complete. This should be sufficient to avoid any nasty thread-safety surprises in * code using this schema. * * @param type the type to complete and store */ private void put(AttributeType type) { type.getSuper(); if (type instanceof ComplexType) { ((ComplexType) type).getDescriptors(); } put(type.getName(), type); } }
/** * Complete the definition of a type and store it in the schema. * * <p>This method calls {@link AttributeType#getSuper()} (and {@link * ComplexType#getDescriptors()} where applicable) to ensure the construction of the type (a * concrete {@link AbstractLazyAttributeTypeImpl} or {@link AbstractLazyComplexTypeImpl} * sublass) is complete. This should be sufficient to avoid any nasty thread-safety surprises in * code using this schema. * * @param type the type to complete and store */ private void put(AttributeType type) { type.getSuper(); if (type instanceof ComplexType) { ((ComplexType) type).getDescriptors(); } put(type.getName(), type); } }
/** * Complete the definition of a type and store it in the schema. * * <p>This method calls {@link AttributeType#getSuper()} (and {@link * ComplexType#getDescriptors()} where applicable) to ensure the construction of the type (a * concrete {@link AbstractLazyAttributeTypeImpl} or {@link AbstractLazyComplexTypeImpl} * sublass) is complete. This should be sufficient to avoid any nasty thread-safety surprises in * code using this schema. * * @param type the type to complete and store */ private void put(AttributeType type) { type.getSuper(); if (type instanceof ComplexType) { ((ComplexType) type).getDescriptors(); } put(type.getName(), type); } }
/** * Complete the definition of a type and store it in the schema. * * <p>This method calls {@link AttributeType#getSuper()} (and {@link * ComplexType#getDescriptors()} where applicable) to ensure the construction of the type (a * concrete {@link AbstractLazyAttributeTypeImpl} or {@link AbstractLazyComplexTypeImpl} * sublass) is complete. This should be sufficient to avoid any nasty thread-safety surprises in * code using this schema. * * @param type the type to complete and store */ private void put(AttributeType type) { type.getSuper(); if (type instanceof ComplexType) { ((ComplexType) type).getDescriptors(); } put(type.getName(), type); } }
/** * Complete the definition of a type and store it in the schema. * * <p>This method calls {@link AttributeType#getSuper()} (and {@link * ComplexType#getDescriptors()} where applicable) to ensure the construction of the type (a * concrete {@link AbstractLazyAttributeTypeImpl} or {@link AbstractLazyComplexTypeImpl} * sublass) is complete. This should be sufficient to avoid any nasty thread-safety surprises in * code using this schema. * * @param type the type to complete and store */ private void put(AttributeType type) { type.getSuper(); if (type instanceof ComplexType) { ((ComplexType) type).getDescriptors(); } put(type.getName(), type); } }
/** * Complete the definition of a type and store it in the schema. * * <p>This method calls {@link AttributeType#getSuper()} (and {@link * ComplexType#getDescriptors()} where applicable) to ensure the construction of the type (a * concrete {@link AbstractLazyAttributeTypeImpl} or {@link AbstractLazyComplexTypeImpl} * sublass) is complete. This should be sufficient to avoid any nasty thread-safety surprises in * code using this schema. * * @param type the type to complete and store */ private void put(AttributeType type) { type.getSuper(); if (type instanceof ComplexType) { ((ComplexType) type).getDescriptors(); } put(type.getName(), type); } }
/** * Complete the definition of a type and store it in the schema. * * <p>This method calls {@link AttributeType#getSuper()} (and {@link * ComplexType#getDescriptors()} where applicable) to ensure the construction of the type (a * concrete {@link AbstractLazyAttributeTypeImpl} or {@link AbstractLazyComplexTypeImpl} * sublass) is complete. This should be sufficient to avoid any nasty thread-safety surprises in * code using this schema. * * @param type the type to complete and store */ private void put(AttributeType type) { type.getSuper(); if (type instanceof ComplexType) { ((ComplexType) type).getDescriptors(); } put(type.getName(), type); } }
String restrictions = "null"; String superType = "null"; if (type.getSuper() != null) { superType = type.getSuper().getName() .getLocalPart().toUpperCase() + "_TYPE"; String superURI = type.getSuper().getName().getNamespaceURI(); if (!uri.equals(superURI)) { superType = ns2import.get(superURI) + "." + superType;
AttributeType superType = type.getSuper();
type.isAbstract(), type.getRestrictions(), type.getSuper(), type.getDescription()); descriptor =
/** Initializes builder state from another attribute type. */ public AttributeTypeBuilder init(AttributeType type) { name = type.getName().getLocalPart(); separator = type.getName().getSeparator(); namespaceURI = type.getName().getNamespaceURI(); isAbstract = type.isAbstract(); if (type.getRestrictions() != null) { restrictions().addAll(type.getRestrictions()); } description = type.getDescription() != null ? type.getDescription().toString() : null; isIdentifiable = type.isIdentified(); binding = type.getBinding(); superType = type.getSuper(); if (type instanceof GeometryType) { crs = ((GeometryType) type).getCoordinateReferenceSystem(); } return this; }
superType = aType.getSuper();
@Test public void testSimpleAttributeFromComplexDeclaration() throws Exception { String res = "/test-data/complexFeature.xsd"; URL resource = getClass().getResource(res); SchemaIndex schemaIndex = EmfComplexFeatureReader.newInstance().parse(resource); AppSchemaFeatureTypeRegistry registry = new AppSchemaFeatureTypeRegistry(); try { registry.addSchemas(schemaIndex); Name tcl = Types.typeName(NS_URI, "TypedCategoryListType"); AttributeType typedCategoryListType = registry.getAttributeType(tcl); Assert.assertNotNull(typedCategoryListType); Assert.assertTrue(typedCategoryListType instanceof ComplexType); AttributeType superType = typedCategoryListType.getSuper(); Assert.assertNotNull(superType); Name superName = superType.getName(); Assert.assertEquals(XS.STRING.getNamespaceURI(), superName.getNamespaceURI()); Assert.assertEquals(XS.STRING.getLocalPart(), superName.getLocalPart()); Assert.assertNotNull(typedCategoryListType.getUserData().get(XSDTypeDefinition.class)); } finally { registry.disposeSchemaIndexes(); } }
/** * Asserts the corresponding properties of <code>type</code> for equality with the provided * parameter values * * @param type * @param name * @param binding * @param restrictions * @param identified * @param _abstract * @param superType * @param nillable */ public static void checkType( AttributeType type, Name name, Class<?> binding, Set<Filter> restrictions, boolean identified, boolean _abstract, AttributeType superType) { assertNotNull(type); assertEquals(name, type.getName()); assertEquals(binding, type.getBinding()); assertNotNull(type.getRestrictions()); assertEquals(restrictions, type.getRestrictions()); assertEquals(identified, type.isIdentified()); assertEquals(_abstract, type.isAbstract()); assertEquals(superType, type.getSuper()); }