Package org.apache.hivemind.definition

Examples of org.apache.hivemind.definition.ConfigurationParserDefinition


                   
                    configurationPoint.setConfigurationTypeName(Map.class.getName());
                }

                // Add parser constructor with direct reference to schema
                ConfigurationParserDefinition parserDef = new ConfigurationParserDefinitionImpl(
                        module, cpd.getContributionsSchema().getLocation(), HiveMindSchemaParser.INPUT_FORMAT_NAME,
                        new HiveMindSchemaParserConstructor(cpd.getContributionsSchema()));
               
                configurationPoint.addParser(parserDef);
            } else if (cpd.getContributionsSchemaId() != null) {
View Full Code Here


            if (schema != null) {
                // TODO: check if schema has already been set
                // TODO: more type related error handling, check root type of schema
               
                // Add parser constructor with direct reference to schema
                ConfigurationParserDefinition parserDef = new ConfigurationParserDefinitionImpl(
                        sourceModule, schemaAssignment.getLocation(), HiveMindSchemaParser.INPUT_FORMAT_NAME,
                        new HiveMindSchemaParserConstructor(schema));
               
                cpd.addParser(parserDef);
               
View Full Code Here

    public void contribute(ContributionContext context)
    {
        // Retrieve parser for HiveMind schema
        ConfigurationPointDefinition cpd = context.getConfigurationPoint()
                .getConfigurationPointDefinition();
        ConfigurationParserDefinition parserDef = cpd.getParser(HiveMindSchemaParser.INPUT_FORMAT_NAME);
        if (parserDef == null)
        {
            // This is a valid situation. The unparsed elements are contributed
            context.mergeContribution(getElements());
        } else {
            // Construct and execute the parser
            ConfigurationParser parser = parserDef.getParserConstructor().constructParser(context);
            Object contribution = parser.parse(context, getElements());
            context.mergeContribution(contribution);
        }
    }
View Full Code Here

        XmlExtensionResolver extensionResolver = new XmlExtensionResolver(definition, errorHandler);
        extensionResolver.resolveSchemas();

        ConfigurationPointDefinition point = definition.getConfigurationPoint("zip.zoop.Zap");
       
        ConfigurationParserDefinition parserDef = point.getParser(HiveMindSchemaParser.INPUT_FORMAT_NAME);
        assertNotNull(parserDef);
       
        assertEquals(parserDef.getParserConstructor().getClass(), HiveMindSchemaParserConstructor.class);

        HiveMindSchemaParserConstructor constructor = (HiveMindSchemaParserConstructor) parserDef.getParserConstructor();
        assertEquals(schema, constructor.getSchema());
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.definition.ConfigurationParserDefinition

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.