Package com.alibaba.citrus.springext

Examples of com.alibaba.citrus.springext.Schema


            init(); // if not inited yet

            // eg. my-conf-point
            String mainName = getName().replace('/', '-');

            Schema mainSchema = loadMainSchema(mainName);
            Schema[] versionedSchemas = loadVersionedSchemas(mainName);

            schemas = new VersionableSchemasImpl(mainSchema, versionedSchemas);
        }
View Full Code Here


            init(); // if not inited yet

            // eg. my-conf-point
            String mainName = getName().replace('/', '-');

            Schema mainSchema = loadMainSchema(mainName);
            Schema[] versionedSchemas = loadVersionedSchemas(mainName);

            schemas = new VersionableSchemasImpl(mainSchema, versionedSchemas);
        }
View Full Code Here

    @Override
    protected void finishProcessIncludes() {
        if (includedSchemaInfoMap != null) {
            for (final IncludedSchemaInfo includedSchemaInfo : includedSchemaInfoMap.values()) {
                Schema includedSchema = includedSchemaInfo.getIncludedSchema();

                includedSchema.transform(SchemaUtil.getAnyElementTransformer(getConfigurationPoints(), new AnyElementVisitor() {
                    public void visitAnyElement(ConfigurationPoint cp) {
                        for (Contribution contribution : includedSchemaInfo) {
                            if (cp instanceof ConfigurationPointImpl) {
                                ((ConfigurationPointImpl) cp).addDependingContribution(contribution);
                            }
View Full Code Here

        // <xsd:include schemaLocation="contribution schema" />
        Set<String> includings = createTreeSet();

        for (Contribution contrib : configurationPoint.getContributions()) {
            Schema contribSchema = contrib.getSchemas().getVersionedSchema(version);

            if (contribSchema == null) {
                contribSchema = contrib.getSchemas().getMainSchema();
            }

            if (contribSchema != null) {
                includings.add(contribSchema.getName());
            }
        }

        for (String including : includings) {
            Element includeElement = schemaRoot.addElement("xsd:include");
View Full Code Here

            }

            private String getNewSchemaLocation(String schemaLocation, String namespace, String systemId) {
                // 根据指定的schemaLocation判断
                if (schemaLocation != null) {
                    Schema schema = schemas.findSchema(schemaLocation);

                    if (schema != null) {
                        return normalizedPrefix + schema.getName();
                    } else {
                        return schemaLocation; // 返回原本的location,但可能是错误的!
                    }
                }

                // 再根据namespace判断
                if (namespace != null) {
                    Set<Schema> nsSchemas = schemas.getNamespaceMappings().get(namespace);

                    if (nsSchemas != null && !nsSchemas.isEmpty()) {
                        // 首先,在所有相同ns的schema中查找版本相同的schema。
                        String versionedExtension = getVersionedExtension(systemId);

                        if (versionedExtension != null) {
                            for (Schema schema : nsSchemas) {
                                if (schema.getName().endsWith(versionedExtension)) {
                                    return normalizedPrefix + schema.getName();
                                }
                            }
                        }

                        // 其次,选择第一个默认的schema,其顺序是:beans.xsd、beans-2.5.xsd、beans-2.0.xsd
View Full Code Here

    }

    public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
        log.trace("Trying to locate XML entity {} as configuration points schema.", systemId);

        Schema schema = schemas.findSchema(systemId);

        if (schema == null) {
            if (defaultEntityResolver != null) {
                return defaultEntityResolver.resolveEntity(publicId, systemId);
            } else {
                return null;
            }
        }

        log.debug("Found XML schema for systemId {}: {}", systemId, schema);

        return new InputSource(schema.getInputStream());
    }
View Full Code Here

        }

        private String getNewSchemaLocation(String schemaLocation, String namespace, String systemId) {
            // 根据指定的schemaLocation判断
            if (schemaLocation != null) {
                Schema schema = schemas.findSchema(schemaLocation);

                if (schema != null) {
                    return prefix + schema.getName();
                } else {
                    return schemaLocation; // 返回原本的location,但可能是错误的!
                }
            }

            // 再根据namespace判断
            if (namespace != null) {
                Set<Schema> nsSchemas = nsToSchemas.get(namespace);

                if (nsSchemas != null && !nsSchemas.isEmpty()) {
                    // 首先,在所有相同ns的schema中查找版本相同的schema。
                    String versionedExtension = getVersionedExtension(systemId);

                    if (versionedExtension != null) {
                        for (Schema schema : nsSchemas) {
                            if (schema.getName().endsWith(versionedExtension)) {
                                return prefix + schema.getName();
                            }
                        }
                    }

                    // 其次,选择第一个默认的schema,其顺序是:beans.xsd、beans-2.5.xsd、beans-2.0.xsd
View Full Code Here

        // <xsd:include schemaLocation="contribution schema" />
        Set<String> includings = createTreeSet();

        for (Contribution contrib : configurationPoint.getContributions()) {
            Schema contribSchema = contrib.getSchemas().getVersionedSchema(version);

            if (contribSchema == null) {
                contribSchema = contrib.getSchemas().getMainSchema();
            }

            if (contribSchema != null) {
                includings.add(contribSchema.getName());
            }
        }

        for (String including : includings) {
            Element includeElement = schemaRoot.addElement("xsd:include");
View Full Code Here

            init(); // if not inited yet

            // eg. my-conf-point
            String mainName = getName().replace('/', '-');

            Schema mainSchema = loadMainSchema(mainName);
            Schema[] versionedSchemas = loadVersionedSchemas(mainName);

            schemas = new VersionableSchemasImpl(mainSchema, versionedSchemas);
        }
View Full Code Here

            init(); // if not inited yet

            // eg. my-conf-point
            String mainName = getName().replace('/', '-');

            Schema mainSchema = loadMainSchema(mainName);
            Schema[] versionedSchemas = loadVersionedSchemas(mainName);

            schemas = new VersionableSchemasImpl(mainSchema, versionedSchemas);
        }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.springext.Schema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.