Examples of ManifestMetadataParser


Examples of org.apache.felix.ipojo.parser.ManifestMetadataParser

     * @param components The iPOJO Header String.
     * @throws IOException    if the manifest can not be found
     * @throws ParseException if the parsing process failed
     */
    private void parse(Bundle bundle, String components) throws IOException, ParseException {
        ManifestMetadataParser parser = new ManifestMetadataParser();
        parser.parseHeader(components);

        // Get the component type declaration
        Element[] metadata = parser.getComponentsMetadata();
        for (int i = 0; i < metadata.length; i++) {
            handleTypeDeclaration(bundle, metadata[i]);
        }

        Dictionary[] instances = parser.getInstances();
        for (int i = 0; instances != null && i < instances.length; i++) {
            handleInstanceDeclaration(bundle, instances[i]);
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.parser.ManifestMetadataParser

        " $namespace=\"org.apache.felix.ipojo.whiteboard\" manipulation { $super=\"org.apache.felix.ipojo.PrimitiveHandler\"" +
        " field { $name=\"m_managers\" $type=\"java.util.List\" }method { $name=\"$init\" }method { $arguments=" +
        "\"{org.apache.felix.ipojo.metadata.Element,java.util.Dictionary}\" $name=\"configure\" }method { $name=\"start\"" +
        " }method { $arguments=\"{int}\" $name=\"stateChanged\" }method { $name=\"stop\" }}}";

    ManifestMetadataParser parser = new ManifestMetadataParser();
    parser.parseHeader(header);

    Element[] elems = parser.getComponentsMetadata();
    Assert.assertEquals(1, elems.length);

    Element element = elems[0];
    Assert.assertEquals("handler", element.getName());
    Assert.assertNull(element.getNameSpace());
View Full Code Here

Examples of org.apache.felix.ipojo.parser.ManifestMetadataParser

     * @param components The iPOJO Header String.
     * @throws IOException if the manifest can not be found
     * @throws ParseException if the parsing process failed
     */
    private void parse(Bundle bundle, String components) throws IOException, ParseException {
        ManifestMetadataParser parser = new ManifestMetadataParser();
        parser.parseHeader(components);

        Element[] metadata = parser.getComponentsMetadata(); // Get the component type declaration
        for (int i = 0; i < metadata.length; i++) {
            createAbstractFactory(bundle, metadata[i]);
        }

        Dictionary[] instances = parser.getInstances();
        for (int i = 0; instances != null && i < instances.length; i++) {
            m_creator.addInstance(instances[i], bundle.getBundleId());
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.parser.ManifestMetadataParser

        if ( ipojoHeader == null )
        {
            throw new ParseException( "Null ipojo header returned for factory: " + factory.getName() );
        }

        ManifestMetadataParser parser = new ManifestMetadataParser();
        parser.parseHeader( ipojoHeader );

        Element[] componentMetas = parser.getComponentsMetadata();

        for ( Element componentMeta : componentMetas )
        {
            String compName = componentMeta.getAttribute( "name" );
            if ( compName.equals( factory.getName() ) )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.