Package com.edb.os.xstream.writer

Examples of com.edb.os.xstream.writer.ClassWriter


     *
     * This gets called with special stuff such as the inner list for a list implementation
     */
    public void startNode(String name) {
        // get the current parent to create the correct class writer for this element
        ClassWriter childWriter = currentParent.createChildWriter(name, currentDepth++);
        stack.add(childWriter);
    }
View Full Code Here


    public void addAttribute(String name, String value) {
        System.out.println("addAttribute - name: " + name + " value: " + value);
    }

    public void setValue(String text) {
        ClassWriter dataClass = stack.peek();
        dataClass.setValue(text);
    }
View Full Code Here

        dataClass.setValue(text);
    }

    public void endNode() {
        currentDepth--;
        ClassWriter poppedElement = stack.pop();

        // check if we are at the top
        if (stack.isEmpty()) {
            currentParent = null;

            // write the return statement
            poppedElement.writeReturnStatement(writer);
        } else {
            // check if the pop results to moving up one level, if so set a new current parent
            // if the next item on the stack as a different index then we are moving up, so set the parent to the next level
            if (poppedElement.depthIndex() != stack.peek().depthIndex()) {
                currentParent = stack.peek();
            }

            currentParent.add(poppedElement, writer);
        }
View Full Code Here

    }

    @SuppressWarnings("rawtypes")
    public void startNode(String name, Class clazz) {

        ClassWriter classWriter;
       
        // determine the type of class provided
        // set initial parent if first run
        if (stack.isEmpty()) {
            classWriter = classWriterFactory.create(name, clazz, currentDepth, paramNameIndex++);
            currentParent = classWriter;
        }
        else {
            classWriter = currentParent.createChildWriter(name, clazz, currentDepth, paramNameIndex);
        }

        stack.push(classWriter);
        currentDepth++;
        paramNameIndex++;

        // inform the writer that it has been located. It is up to it if it needs to write something (like new) to the writer
        classWriter.create(writer);
   
View Full Code Here

TOP

Related Classes of com.edb.os.xstream.writer.ClassWriter

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.