Java Code Examples for com.sun.xml.internal.bind.v2.runtime.reflect.Lister#startPacking()

The following examples show how to use com.sun.xml.internal.bind.v2.runtime.reflect.Lister#startPacking() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Scope.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a new item to this packing scope.
 */
public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }

        lister.addToPack(pack,value);
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 2
Source File: Scope.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts the packing scope, without adding any item.
 *
 * This allows us to return an empty pack, thereby allowing the user
 * to distinguish empty array vs null array.
 */
public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 3
Source File: Scope.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a new item to this packing scope.
 */
public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }

        lister.addToPack(pack,value);
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 4
Source File: Scope.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts the packing scope, without adding any item.
 *
 * This allows us to return an empty pack, thereby allowing the user
 * to distinguish empty array vs null array.
 */
public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 5
Source File: Scope.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a new item to this packing scope.
 */
public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }

        lister.addToPack(pack,value);
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 6
Source File: Scope.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts the packing scope, without adding any item.
 *
 * This allows us to return an empty pack, thereby allowing the user
 * to distinguish empty array vs null array.
 */
public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 7
Source File: Scope.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a new item to this packing scope.
 */
public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }

        lister.addToPack(pack,value);
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 8
Source File: Scope.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts the packing scope, without adding any item.
 *
 * This allows us to return an empty pack, thereby allowing the user
 * to distinguish empty array vs null array.
 */
public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 9
Source File: Scope.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a new item to this packing scope.
 */
public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }

        lister.addToPack(pack,value);
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 10
Source File: Scope.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts the packing scope, without adding any item.
 *
 * This allows us to return an empty pack, thereby allowing the user
 * to distinguish empty array vs null array.
 */
public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 11
Source File: Scope.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a new item to this packing scope.
 */
public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }

        lister.addToPack(pack,value);
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 12
Source File: Scope.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts the packing scope, without adding any item.
 *
 * This allows us to return an empty pack, thereby allowing the user
 * to distinguish empty array vs null array.
 */
public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().getTarget();
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 13
Source File: Scope.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a new item to this packing scope.
 */
public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().target;
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }

        lister.addToPack(pack,value);
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 14
Source File: Scope.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts the packing scope, without adding any item.
 *
 * This allows us to return an empty pack, thereby allowing the user
 * to distinguish empty array vs null array.
 */
public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().target;
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 15
Source File: Scope.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a new item to this packing scope.
 */
public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().target;
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }

        lister.addToPack(pack,value);
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}
 
Example 16
Source File: Scope.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts the packing scope, without adding any item.
 *
 * This allows us to return an empty pack, thereby allowing the user
 * to distinguish empty array vs null array.
 */
public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
    try {
        if(!hasStarted()) {
            this.bean = (BeanT)context.getCurrentState().target;
            this.acc = acc;
            this.lister = lister;
            this.pack = lister.startPacking(bean,acc);
        }
    } catch (AccessorException e) {
        Loader.handleGenericException(e,true);
        // recover from this error by ignoring future items.
        this.lister = Lister.getErrorInstance();
        this.acc = Accessor.getErrorInstance();
    }
}