for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next(); if (ft.getName().equals(element.getName())) { for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) { XSDTypeDefinition typedef = (XSDTypeDefinition) t.next(); if ((ft.getName() + "_Type").equals(typedef.getName())) {
@Override public Object getProperty(Object object, QName name) throws Exception { if (WFS.member.equals(name)) { return ((ValueCollectionType) object).getMember().iterator().next(); } return null; // else { // return WFSParsingUtils.FeatureCollectionType_getProperty((EObject)object, name); // } } }
/** * Copies all the properties from one object to anoter. * * @param source The object to copy from. * @param target The object to copy to. */ public static void copy(EObject source, EObject target) { for (Iterator i = source.eClass().getEStructuralFeatures().iterator(); i.hasNext(); ) { EStructuralFeature feature = (EStructuralFeature) i.next(); target.eSet(feature, source.eGet(feature)); } } }
private void getSubProjects(Project project, Set<Project> projects) { projects.add(project); Iterator<Project> iterator = project.getSubProjects().iterator(); while (iterator.hasNext()) { Project subProject = iterator.next(); getSubProjects(subProject, projects); } } }
@Override public Element encode(Object object, Document document, Element value) throws Exception { Element e = super.encode(object, document, value); InsertResultsType resultType = (InsertResultsType) object; Iterator it = resultType.getFeature().iterator(); while (it.hasNext()) { Iterator fidit = ((InsertedFeatureType) it.next()).getFeatureId().iterator(); while (fidit.hasNext()) { Element node = document.createElementNS(OGC.NAMESPACE, "FeatureId"); node.setAttribute("fid", fidit.next().toString()); e.appendChild(node); } } return e; } }
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { InsertResultsType resultType = (InsertResultsType) super.parse(instance, node, value); // remove 'none' Iterator it = resultType.getFeature().iterator(); while (it.hasNext()) { EList fids = ((InsertedFeatureType) it.next()).getFeatureId(); if (fids.size() == 1 && "none".equals(fids.get(0).toString())) { it.remove(); } } return resultType; } }
protected void buildElementIndex() { elementIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next(); QName qName = new QName(element.getTargetNamespace(), element.getName()); elementIndex.put(qName, element); } } }
private void clean() { Iterator<EClassifier> iterator = schemaPack.getEClassifiers().iterator(); while (iterator.hasNext()) { EClassifier eClassifier = iterator.next(); if (eClassifier instanceof EClass) { EClass eClass = (EClass) eClassifier; if (eClass.getEAnnotation("wrapped") != null) { if (eClass.getESuperTypes().size() == 1) { // iterator.remove(); } } } } }
protected void buildAttriubuteIndex() { attributeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator a = schema.getAttributeDeclarations().iterator(); a.hasNext(); ) { XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) a.next(); QName qName = new QName(attribute.getTargetNamespace(), attribute.getName()); attributeIndex.put(qName, attribute); } } }
protected void buildAttributeGroupIndex() { attributeGroupIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator g = schema.getAttributeGroupDefinitions().iterator(); g.hasNext(); ) { XSDAttributeGroupDefinition group = (XSDAttributeGroupDefinition) g.next(); QName qName = new QName(group.getTargetNamespace(), group.getName()); attributeGroupIndex.put(qName, group); } } }
protected void buildComplexTypeIndex() { complexTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDComplexTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); complexTypeIndex.put(qName, type); } } } }
@Override public Element encode(Object object, Document document, Element value) throws Exception { Element e = super.encode(object, document, value); QueryType resultType = (QueryType) object; Iterator it = resultType.getAbstractProjectionClause().iterator(); while (it.hasNext()) { Element node = document.createElementNS(WFS.NAMESPACE, "PropertyName"); node.setTextContent(Converters.convert(it.next(), String.class)); e.appendChild(node); } return e; } }
protected void buildSimpleTypeIndex() { simpleTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDSimpleTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); simpleTypeIndex.put(qName, type); } } } }
protected final AttributeType xsAnyType() { XSDSchema schema = XSDUtil.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); for ( Iterator i = schema.getTypeDefinitions().iterator(); i.hasNext(); ) { XSDTypeDefinition t = (XSDTypeDefinition) i.next(); if ( XS.ANYTYPE.getLocalPart().equals( t.getName() ) ) { return findType(t); } } throw new IllegalStateException("XS schema not present"); }
/** * Searches <code>schema</code> for an element which matches <code>name</code>. * * @param schema The schema * @param name The element to search for * @return The element declaration, or null if it could not be found. */ public static XSDElementDeclaration getElementDeclaration(XSDSchema schema, QName name) { for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next(); if (element.getTargetNamespace().equals(name.getNamespaceURI())) { if (element.getName().equals(name.getLocalPart())) { return element; } } } return null; }
private void compareEEnum(EEnum eEnum1, EEnum eEnum2) throws SchemaCompareException { if (eEnum1.getELiterals().size() != eEnum2.getELiterals().size()) { throw new SchemaCompareException("Not the same amount of literals"); } Iterator<EEnumLiteral> iterator1 = eEnum1.getELiterals().iterator(); Iterator<EEnumLiteral> iterator2 = eEnum2.getELiterals().iterator(); while (iterator1.hasNext()) { EEnumLiteral enumLiteral1 = iterator1.next(); EEnumLiteral enumLiteral2 = iterator2.next(); if (!enumLiteral1.getName().equals(enumLiteral2.getName())) { throw new SchemaCompareException("Literal not the same"); } } } }
protected final XSDTypeDefinition findGlobalElementXSDType(XSDElementDeclaration element) { for (Iterator i = schema.getElementDeclarations().iterator(); i.hasNext();) { XSDElementDeclaration e = (XSDElementDeclaration) i.next(); if (element.getName().equals( e.getName() ) && (element.getTargetNamespace() == null || element.getTargetNamespace().equals( e.getTargetNamespace() ) ) ) { return e.getType(); } } return null; }
private void comparePackage(EPackage package1, EPackage package2) throws SchemaCompareException { if (!package1.getName().equals(package2.getName())) { throw new SchemaCompareException("Schema package names not the same"); } if (package1.getEClassifiers().size() != package2.getEClassifiers().size()) { throw new SchemaCompareException("Not the same amount of classifiers in package " + package1.getName()); } Iterator<EClassifier> classifierIterator1 = package1.getEClassifiers().iterator(); Iterator<EClassifier> classifierIterator2 = package2.getEClassifiers().iterator(); while (classifierIterator1.hasNext()) { EClassifier classifier1 = classifierIterator1.next(); EClassifier classifier2 = classifierIterator2.next(); compareClassifier(classifier1, classifier2); } }
private void compareEClass(EClass eClass1, EClass eClass2) throws SchemaCompareException { if (eClass1.getEAllStructuralFeatures().size() != eClass2.getEAllStructuralFeatures().size()) { throw new SchemaCompareException("Not the same amount of features in " + eClass1.getName()); } Iterator<EStructuralFeature> iterator1 = eClass1.getEAllStructuralFeatures().iterator(); Iterator<EStructuralFeature> iterator2 = eClass2.getEAllStructuralFeatures().iterator(); while (iterator1.hasNext()) { EStructuralFeature structuralFeature1 = iterator1.next(); EStructuralFeature structuralFeature2 = iterator2.next(); if (!structuralFeature1.getName().equals(structuralFeature2.getName())) { throw new SchemaCompareException("Features not the same name"); } if (!structuralFeature1.getEType().getName().equals(structuralFeature2.getEType().getName())) { throw new SchemaCompareException("Features not of the same type"); } } }
public RevisionStackFrame(QueryObjectProvider queryObjectProvider, long roid) throws BimserverDatabaseException { this.queryObjectProvider = queryObjectProvider; this.roid = roid; currentRevision = (Revision) queryObjectProvider.getDatabaseSession().get(StorePackage.eINSTANCE.getRevision(), roid, OldQuery.getDefault()); concreteRevisionIterator = currentRevision.getConcreteRevisions().iterator(); }