Package org.apache.hivemind.impl

Examples of org.apache.hivemind.impl.ElementImpl


     * attributes and content.
     */

    private void beginCollectServiceParameters(String elementName)
    {
        ElementImpl element = buildLWDomElement(elementName);

        AbstractServiceInvocationDescriptor sid = (AbstractServiceInvocationDescriptor) peekObject();

        sid.addParameter(element);

View Full Code Here


    private void beginContribution(String elementName)
    {
        // This is where things get tricky, the point where we outgrew Jakarta Digester.

        ElementImpl element = buildLWDomElement(elementName);

        ContributionDescriptor ed = (ContributionDescriptor) peekObject();
        ed.addElement(element);

        push(elementName, element, STATE_LWDOM, false);
View Full Code Here

        unexpectedElement(elementName);
    }

    private void beginLWDom(String elementName)
    {
        ElementImpl element = buildLWDomElement(elementName);

        ElementImpl parent = (ElementImpl) peekObject();
        parent.addElement(element);

        push(elementName, element, STATE_LWDOM, false);
    }
View Full Code Here

            super.push(elementName, object, state, true);
    }

    private ElementImpl buildLWDomElement(String elementName)
    {
        ElementImpl result = new ElementImpl();
        result.setElementName(elementName);

        Iterator i = _attributes.entrySet().iterator();
        while (i.hasNext())
        {
            Map.Entry entry = (Map.Entry) i.next();

            String name = (String) entry.getKey();
            String value = (String) entry.getValue();

            Attribute a = new AttributeImpl(name, value);

            result.addAttribute(a);
        }

        return result;
    }
View Full Code Here

        cd.addRulesForModel();
    }

    private void endLWDom()
    {
        ElementImpl element = (ElementImpl) peekObject();
        element.setContent(peekContent());
    }
View Full Code Here

        return result;
    }

    private Element forgeElement()
    {
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestEnumerationTranslator.class"), 50);
        e.setLocation(l);

        return e;
    }
View Full Code Here

{
    public void testPushContentRule()
    {
        MockControl control = newControl(SchemaProcessor.class);

        ElementImpl element = new ElementImpl();
        element.setElementName("myelement");

        element.setContent("${flintstone}");

        PushContentRule rule = new PushContentRule();

        SchemaProcessor mockProcessor = (SchemaProcessor) control.getMock();

        mockProcessor.getContentTranslator();
        control.setReturnValue(new NullTranslator());

        mockProcessor.getContributingModule();

        MockControl moduleControl = newControl(Module.class);
        Module mockModule = (Module) moduleControl.getMock();

        control.setReturnValue(mockModule, 2);

        mockModule.expandSymbols("${flintstone}", element.getLocation());
        moduleControl.setReturnValue("FLINTSTONE");

        mockProcessor.push("FLINTSTONE");
        mockProcessor.pop();
View Full Code Here

    }

    public void testBadClass() throws Exception
    {
        InstanceTranslator t = new InstanceTranslator();
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestInstanceTranslator.class"), 50);
        e.setLocation(l);

        Module m = newModule();

        m.resolveType("bad.class.Name");
        ApplicationRuntimeException cause = new ApplicationRuntimeException("failure");
View Full Code Here

    }

    public void testPrivateObject() throws Exception
    {
        InstanceTranslator t = new InstanceTranslator();
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestInstanceTranslator.class"), 50);
        e.setLocation(l);

        ModuleImpl m = new ModuleImpl();
        m.setClassResolver(getClassResolver());

        replayControls();
View Full Code Here

{
    public void testPushAttributeRule()
    {
        MockControl control = newControl(SchemaProcessor.class);

        ElementImpl element = new ElementImpl();
        element.setElementName("myelement");

        Attribute attribute = new AttributeImpl("fred", "${flintstone}");

        element.addAttribute(attribute);

        PushAttributeRule rule = new PushAttributeRule();

        rule.setAttributeName("fred");

        SchemaProcessor mockProcessor = (SchemaProcessor) control.getMock();

        mockProcessor.getAttributeTranslator("fred");
        control.setReturnValue(new NullTranslator());

        mockProcessor.getContributingModule();

        MockControl moduleControl = newControl(Module.class);
        Module mockModule = (Module) moduleControl.getMock();

        control.setReturnValue(mockModule, 2);

        mockModule.expandSymbols("${flintstone}", element.getLocation());
        moduleControl.setReturnValue("FLINTSTONE");

        mockProcessor.push("FLINTSTONE");
        mockProcessor.pop();
View Full Code Here

TOP

Related Classes of org.apache.hivemind.impl.ElementImpl

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.