public Map<Object, Object> getUserData() { return getSubject().getUserData(); }
static boolean equals(AttributeDescriptor a, AttributeDescriptor b, boolean compareUserMaps) { if (a == b) return true; if (a == null) return true; if (!a.equals(b)) return false; if (compareUserMaps) { if (!equals(a.getUserData(), b.getUserData())) return false; if (!equals(a.getType().getUserData(), b.getType().getUserData())) return false; } return true; }
if (!type.getUserData().isEmpty()) { for (Iterator i = type.getUserData().entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); Name n = (Name) entry.getKey();
if (!type.getUserData().isEmpty()) { for (Map.Entry<Object, Object> entry : type.getUserData().entrySet()) { PropertyDescriptor pd = (PropertyDescriptor) entry.getValue(); PropertyType pdType = pd.getType();
target.getType().getUserData().put("schemaURI", schemaURIs);
.getTargetFeature() .getType() .getUserData() .get("targetVersion"); CoordinateReferenceSystem target; Object crsobject = this.mapping.getTargetFeature().getType().getUserData().get("targetCrs"); if (crsobject instanceof CoordinateReferenceSystem) { target = (CoordinateReferenceSystem) crsobject; mapping.getTargetFeature().getType().getUserData().put("targetVersion", null); mapping.getTargetFeature().getType().getUserData().put("targetCrs", null);
attType.getUserData().put(XSDTypeDefinition.class, typeDefinition);
Assert.assertTrue(type.getClass().getName(), type instanceof ComplexType); Assert.assertTrue( type.getUserData().get(XSDTypeDefinition.class) instanceof XSDComplexTypeDefinition);
@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(); } }
public Map<Object, Object> getUserData() { return getSubject().getUserData(); }
public Map<Object, Object> getUserData() { return getSubject().getUserData(); }
Assert.assertEquals(typeName, type.getName()); Assert.assertTrue( type.getUserData().get(XSDTypeDefinition.class) instanceof XSDComplexTypeDefinition); Assert.assertFalse(type instanceof FeatureType); Assert.assertTrue( type.getUserData().get(XSDTypeDefinition.class) instanceof XSDComplexTypeDefinition);
static boolean equals( AttributeDescriptor a, AttributeDescriptor b, boolean compareUserMaps) { if(a == b) return true; if(a == null) return true; if(!a.equals(b)) return false; if(compareUserMaps) { if(!equals(a.getUserData(), b.getUserData())) return false; if(!equals(a.getType().getUserData(), b.getType().getUserData())) return false; } return true; }
target.getType().getUserData().put("schemaURI", schemaURIs);
attType.getUserData().put(XSDTypeDefinition.class, typeDefinition);
String version=(String)this.mapping.getTargetFeature().getType().getUserData().get("targetVersion"); Object crsobject = this.mapping.getTargetFeature().getType().getUserData().get("targetCrs"); if (crsobject instanceof CoordinateReferenceSystem) { target = (CoordinateReferenceSystem) crsobject; mapping.getTargetFeature().getType().getUserData().put("targetVersion", null); mapping.getTargetFeature().getType().getUserData().put("targetCrs", null);
attType.getUserData().put(XSDTypeDefinition.class, typeDefinition);
Assert.assertNotNull(type); Assert.assertTrue(type.getClass().getName(), type instanceof ComplexType); Assert.assertTrue(type.getUserData().get(XSDTypeDefinition.class) instanceof XSDComplexTypeDefinition);
@Test public void testSimpleAttributeFromComplexDeclaration() throws Exception { String res = "/test-data/complexFeature.xsd"; URL resource = getClass().getResource(res); SchemaIndex schemaIndex = EmfAppSchemaReader.newInstance().parse(resource); FeatureTypeRegistry registry = new FeatureTypeRegistry(); 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(); } }
Assert.assertFalse(type instanceof SimpleFeatureType); Assert.assertEquals(typeName, type.getName()); Assert.assertTrue(type.getUserData().get(XSDTypeDefinition.class) instanceof XSDComplexTypeDefinition); Assert.assertTrue(type instanceof ComplexType); Assert.assertFalse(type instanceof FeatureType); Assert.assertTrue(type.getUserData().get(XSDTypeDefinition.class) instanceof XSDComplexTypeDefinition);