Examples of PAPIElement


Examples of com.volantis.mcs.papi.PAPIElement

    /* (non-Javadoc)
     * @see com.volantis.mcs.marlin.sax.MarlinElementHandler#createPAPIElement
     * (com.volantis.mcs.marlin.sax.PAPIContentHandlerContext)
     */
    public PAPIElement createPAPIElement(PAPIContentHandlerContext context) {
        PAPIElement element;
       
        if(context.getNativeMarkupDepth() == 0) { 
            element = new PickleInlineElementImpl();
        } else {
            element = new PickleNativeElementImpl();
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

        }

        // Get the current request context
        MarinerRequestContext requestContext = context.getRequestContext();

        PAPIElement element = elementStackEntry.element;
        PAPIAttributes attributes = elementStackEntry.attributes;

        try {
            // Get the content writer for the element.
            Writer writer = element.getContentWriter(requestContext, attributes);

            // Write the content out to the body of the element.
            writer.write(characters, start, length);
        } catch (PAPIException e) {
            throw new ExtendedSAXParseException(null, marlinContext.getLocator(), e);
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

        // retrieved values being correct.
        handler.beforePAPIElement(context, attributes);

        // Create an instance of the PAPIElement derived class specific to the
        // current element.
        PAPIElement element = handler.createPAPIElement(context);

        // Initialise the entry to push on the stack.
        //elementStackEntry.localName = localName;
        elementStackEntry.handler = handler;
        elementStackEntry.element = element;
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

     * @throws SAXParseException
     */
    protected void callPAPIElementStart() throws SAXParseException {
        MarinerRequestContext requestContext = context.getRequestContext();

        PAPIElement element = elementStackEntry.element;
        PAPIAttributes attributes = elementStackEntry.attributes;

        try {
            // Invoke the PAPIElement's elementStart method.
            int result = element.elementStart(requestContext, attributes);

            switch (result) {
                case PAPIConstants.PROCESS_ELEMENT_BODY:
                    // Do nothing.
                    break;
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

            throws SAXException {

        // Get the current request context
        MarinerRequestContext requestContext = context.getRequestContext();

        PAPIElement element = elementStackEntry.element;
        PAPIAttributes attributes = elementStackEntry.attributes;

        try {
            // Invoke the PAPIElement's elementEnd method.
            int result = element.elementEnd(requestContext, attributes);

            // Reset the element, make sure that it uses the same context as was
            // passed to the elementStart and elementEnd methods.
            element.elementReset(requestContext);

            // Make sure that the context is correctly cleaned up for the
            // elements, this may change the context so do not rely on any
            // previously retrieved values being correct.
            handler.afterPAPIElement(context, attributes);
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

            papiFactory.getPAPIElementFactory(name.toLowerCase());

        assertNotNull("Unknown element name, '" + name + "' check testcase.",
            factory);

        PAPIElement element = factory.createPAPIElement();
        PAPIAttributes attributes = factory.createElementSpecificAttributes();

        // If we are opening a subclass of BaseAttributes
        // then param[0] will be a style class name
        if (attributes instanceof BaseAttributes && params.length >= 1 &&
            params[0] != null) {
            BaseAttributes ba = (BaseAttributes)attributes;
            ba.setStyleClass(params[0]);
        }

        // If we are opening a Pane param[1] will be the name
        if (attributes instanceof PaneAttributes && params.length >= 2) {
            PaneAttributes pa = (PaneAttributes)attributes;
            pa.setName(params[1]);
        }

        // If its a Canvas then param[1] will be the page title,
        // param[2] the theme file name
        // param[3] the layout file name and
        // param[4] the type.
        if (attributes instanceof CanvasAttributes && params.length >= 5) {
            CanvasAttributes ca = (CanvasAttributes)attributes;
            ca.setPageTitle(params[1]);
            ca.setTheme(params[2]);
            ca.setLayoutName(params[3]);

            if (params[4] != null) {
                ca.setType(params[4]);
            }
        }

        // If we are opening a Region param[1] will be the name
        if (attributes instanceof RegionAttributes && params.length >= 2) {
            RegionAttributes ra = (RegionAttributes)attributes;
            ra.setName(params[1]);
        }

        // Process start element, this is the thing which does
        // the work.
        int result = element.elementStart(getCurrentRequestContext(), attributes);

        assertEquals("Open did not return PROCESS_ELEMENT_BODY as expected",
            result, PROCESS_ELEMENT_BODY);

        // Push the element on the stack so that we can close it later.
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

    protected void close(String name) throws PAPIException {
        PAPIElementFactory factory =
            papiFactory.getPAPIElementFactory(name.toLowerCase());
        PAPIAttributes papiAttr = factory.createElementSpecificAttributes();

        PAPIElement element = (PAPIElement)elements.pop();
        int result = element.elementEnd(getCurrentRequestContext(), papiAttr);

        assertEquals("Close did not return CONTINUE_PROCESSING as expected",
            result, CONTINUE_PROCESSING);

    }
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

     * @param message Massage to write.
     * @throws PAPIException
     */
    protected void writeMessage(String message) throws PAPIException {

        PAPIElement element = (PAPIElement)elements.peek();
        element.elementContent(getCurrentRequestContext(), null, message);
    }
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

            papiFactory.getPAPIElementFactory("pane");

        assertNotNull("Unknown element name, pane check testcase.",
            factory);

        PAPIElement element = factory.createPAPIElement();
        PaneAttributes attributes = (PaneAttributes)
                factory.createElementSpecificAttributes();

        attributes.setName("pane");

        // Process start element, this is the thing which does
        // the work.
        int result = element.elementStart(getCurrentRequestContext(), attributes);

        assertEquals("Open did not return PROCESS_ELEMENT_BODY as expected",
            result, PROCESS_ELEMENT_BODY);

        // Push the element on the stack so that we can close it later.
View Full Code Here

Examples of com.volantis.mcs.papi.PAPIElement

            papiFactory.getPAPIElementFactory("select");

        assertNotNull("Unknown element name, select check testcase.",
            factory);

        PAPIElement element = factory.createPAPIElement();
        SelectAttributes attributes = (SelectAttributes)
                factory.createElementSpecificAttributes();

        // Process start element, this is the thing which does
        // the work.
        int result = element.elementStart(getCurrentRequestContext(), attributes);

        assertEquals("Open did not return PROCESS_ELEMENT_BODY as expected",
            result, PROCESS_ELEMENT_BODY);

        // Push the element on the stack so that we can close it later.
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.