Package com.alibaba.citrus.springext.ResourceResolver

Examples of com.alibaba.citrus.springext.ResourceResolver.PropertyHandler


            SpringSchemasSourceInfoImpl() {
            }
        }

        // spring.tooling
        resourceResolver.loadAllProperties(TOOLING_PARAMS_LOCATION, new PropertyHandler() {
            public void handle(String key, String value, Resource source, int lineNumber) {
                String namespaceAndParamName = trimToNull(key);

                if (namespaceAndParamName != null) {
                    int index = namespaceAndParamName.indexOf("@");
                    String namespace = null;
                    String paramName = null;

                    if (index >= 0) {
                        namespace = trimToNull(namespaceAndParamName.substring(0, index));
                        paramName = trimToNull(namespaceAndParamName.substring(index + 1));
                    }

                    if (namespace != null && paramName != null) {
                        Map<String, String> params = toolingParameters.get(namespace);

                        if (params == null) {
                            params = createHashMap();
                            toolingParameters.put(namespace, params);
                        }

                        params.put(paramName, trimToNull(value));
                    }
                }
            }
        });

        // spring.schemas
        resourceResolver.loadAllProperties(SCHEMA_MAPPINGS_LOCATION, new PropertyHandler() {
            public void handle(String key, String value, Resource source, int lineNumber) {
                String uri = trimToNull(key);
                String classpathLocation = trimToNull(value);

                if (uri == null || classpathLocation == null) {
                    return; // invalid and ignored
                }

                String schemaName = getSchemaName(uri);
                Matcher matcher = SCHEMA_VERSION_PATTERN.matcher(schemaName);
                String version = null;

                if (matcher.find()) {
                    version = matcher.group(1);
                }

                SpringSchemasSourceInfoImpl pluginSourceInfo = new SpringSchemasSourceInfoImpl();
                pluginSourceInfo.setSource(source, lineNumber);

                Resource schemaSource = getResource(classpathLocation, uri);

                if (schemaSource != null) {
                    Schema schema = SchemaImpl.createSpringPluggableSchema(
                            schemaName, version, true, desc, schemaSource,
                            new SourceInfoSupport<SpringSchemasSourceInfo>(pluginSourceInfo).setSource(schemaSource), toolingParameters);

                    nameToSchemaMappings.put(schemaName, schema);
                    uriToNameMappings.put(uri, schemaName);

                    String namespace = schema.getTargetNamespace();

                    if (namespace != null) {
                        namespaces.add(namespace);
                    }
                }
            }
        });

        // 在spring.handlers中,有一些namespace是没有schema的(例如:http://www.springframework.org/schema/p),所以在spring.schemas中找不到。
        // 但我们需要在这里把它引进来,以方便IDE plugins读取。
        resourceResolver.loadAllProperties(HANDLER_MAPPINGS_LOCATION, new PropertyHandler() {
            public void handle(String key, String value, Resource source, int lineNumber) {
                String namespace = trimToNull(key);

                if (namespace != null) {
                    namespaces.add(namespace);
View Full Code Here


    }

    private void loadConfigurationPoints() {
        log.trace("Trying to load configuration points at {}", configurationPointsLocation);

        settings.resourceResolver.loadAllProperties(configurationPointsLocation, new PropertyHandler() {
            public void handle(String key, String value, Resource source, int lineNumber) {
                String name = normalizeConfigurationPointName(key);

                if (name == null) {
                    return;
View Full Code Here

        log.trace("Trying to load contributions at {}", contribLocation);

        final Map<String, String> sortedMappings = createTreeMap();

        settings.resourceResolver.loadAllProperties(contribLocation, new PropertyHandler() {
            public void handle(String key, String value, Resource source, int lineNumber) {
                String contribName = trimToNull(key);
                String contribClassName = trimToNull(value);

                if (getDefaultElementName() != null && isEquals(contribName, getDefaultElementName())) {
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.springext.ResourceResolver.PropertyHandler

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.