public void add(LocalElementDeclaration led) { String namespace = led.getNamespace(); String prefix = addNamespace(namespace); SchemaInfo schemaInfo = namespacesToSchemas.get(namespace); if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(prefix); schemaInfo.setNamespace(namespace); namespacesToSchemas.put(namespace, schemaInfo); } schemaInfo.getLocalElementDeclarations().add(led); addReferencedTypeDefinitions(led); }
/** * Add a root element to the model. * * @param rootElement The root element to add. */ public void add(RootElementDeclaration rootElement) { add(rootElement.getSchema()); String namespace = rootElement.getNamespace(); String prefix = addNamespace(namespace); SchemaInfo schemaInfo = namespacesToSchemas.get(namespace); if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(prefix); schemaInfo.setNamespace(namespace); namespacesToSchemas.put(namespace, schemaInfo); } schemaInfo.getGlobalElements().add(rootElement); int position = Collections.binarySearch(this.rootElements, rootElement, CLASS_COMPARATOR); if (position < 0) { this.rootElements.add(-position - 1, rootElement); } }
/** * Add a root element to the model. * * @param rootElement The root element to add. */ public void add(RootElementDeclaration rootElement) { int position = Collections.binarySearch(this.rootElements, rootElement, CLASS_COMPARATOR); if (position < 0) { this.rootElements.add(-position - 1, rootElement); add(rootElement.getSchema()); String namespace = rootElement.getNamespace(); String prefix = addNamespace(namespace); SchemaInfo schemaInfo = namespacesToSchemas.get(namespace); if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(prefix); schemaInfo.setNamespace(namespace); namespacesToSchemas.put(namespace, schemaInfo); } schemaInfo.getGlobalElements().add(rootElement); if (includeReferencedClasses()) { REFERENCE_STACK.get().addFirst("root element " + rootElement.getQualifiedName()); addReferencedTypeDefinitions(rootElement); REFERENCE_STACK.get().removeFirst(); } } }
/** * Add an XML registry. * * @param registry The registry to add. */ public void add(Registry registry) { add(registry.getSchema()); String namespace = registry.getSchema().getNamespace(); String prefix = addNamespace(namespace); SchemaInfo schemaInfo = namespacesToSchemas.get(namespace); if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(prefix); schemaInfo.setNamespace(namespace); namespacesToSchemas.put(namespace, schemaInfo); } schemaInfo.getRegistries().add(registry); REFERENCE_STACK.get().addFirst("registry " + registry.getQualifiedName()); addReferencedTypeDefinitions(registry); for (LocalElementDeclaration led : registry.getLocalElementDeclarations()) { REFERENCE_STACK.get().addFirst("method " + led.getSimpleName()); add(led); REFERENCE_STACK.get().removeFirst(); } REFERENCE_STACK.get().removeFirst(); }
if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(addNamespace(particleNamespace)); schemaInfo.setNamespace(particleNamespace); namespacesToSchemas.put(particleNamespace, schemaInfo);
if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(prefix); schemaInfo.setNamespace(namespace); namespacesToSchemas.put(namespace, schemaInfo); if (referencedSchemaInfo == null) { referencedSchemaInfo = new SchemaInfo(); referencedSchemaInfo.setId(addNamespace(implicitElementNamespace)); referencedSchemaInfo.setNamespace(implicitElementNamespace); namespacesToSchemas.put(implicitElementNamespace, referencedSchemaInfo); if (referencedSchemaInfo == null) { referencedSchemaInfo = new SchemaInfo(); referencedSchemaInfo.setId(addNamespace(implicitAttributeNamespace)); referencedSchemaInfo.setNamespace(implicitAttributeNamespace); namespacesToSchemas.put(implicitAttributeNamespace, referencedSchemaInfo);
if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(addNamespace(particleNamespace)); schemaInfo.setNamespace(particleNamespace); namespacesToSchemas.put(particleNamespace, schemaInfo);
if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(prefix); schemaInfo.setNamespace(namespace); namespacesToSchemas.put(namespace, schemaInfo); if (referencedSchemaInfo == null) { referencedSchemaInfo = new SchemaInfo(); referencedSchemaInfo.setId(addNamespace(implicitElementNamespace)); referencedSchemaInfo.setNamespace(implicitElementNamespace); namespacesToSchemas.put(implicitElementNamespace, referencedSchemaInfo); if (referencedSchemaInfo == null) { referencedSchemaInfo = new SchemaInfo(); referencedSchemaInfo.setId(addNamespace(implicitAttributeNamespace)); referencedSchemaInfo.setNamespace(implicitAttributeNamespace); namespacesToSchemas.put(implicitAttributeNamespace, referencedSchemaInfo);
if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(prefix); schemaInfo.setNamespace(namespace); namespacesToSchemas.put(namespace, schemaInfo);
if (schemaInfo == null) { schemaInfo = new SchemaInfo(); schemaInfo.setId(prefix); schemaInfo.setNamespace(namespace); namespacesToSchemas.put(namespace, schemaInfo);