Java Code Examples for com.sun.istack.internal.FinalArrayList#add()

The following examples show how to use com.sun.istack.internal.FinalArrayList#add() . 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: StreamHeader12.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_2_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            } else if (SOAP_1_2_RELAY.equals(localName)) {
                _isRelay = Util.parseBool(value);
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 2
Source File: StreamHeader12.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_2_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            } else if (SOAP_1_2_RELAY.equals(localName)) {
                _isRelay = Util.parseBool(value);
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 3
Source File: StreamHeader11.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_ACTOR_NEXT;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_1_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_1_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 4
Source File: ContextFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Look for jaxb.index file in the specified package and load it's contents
 *
 * @param pkg package name to search in
 * @param classLoader ClassLoader to search in
 * @return a List of Class objects to load, null if there weren't any
 * @throws IOException if there is an error reading the index file
 * @throws JAXBException if there are any errors in the index file
 */
private static List<Class> loadIndexedClasses(String pkg, ClassLoader classLoader) throws IOException, JAXBException {
    final String resource = pkg.replace('.', '/') + "/jaxb.index";
    final InputStream resourceAsStream = classLoader.getResourceAsStream(resource);

    if (resourceAsStream == null) {
        return null;
    }

    BufferedReader in =
            new BufferedReader(new InputStreamReader(resourceAsStream, "UTF-8"));
    try {
        FinalArrayList<Class> classes = new FinalArrayList<Class>();
        String className = in.readLine();
        while (className != null) {
            className = className.trim();
            if (className.startsWith("#") || (className.length() == 0)) {
                className = in.readLine();
                continue;
            }

            if (className.endsWith(".class")) {
                throw new JAXBException(Messages.ILLEGAL_ENTRY.format(className));
            }

            try {
                classes.add(classLoader.loadClass(pkg + '.' + className));
            } catch (ClassNotFoundException e) {
                throw new JAXBException(Messages.ERROR_LOADING_CLASS.format(className, resource),e);
            }

            className = in.readLine();
        }
        return classes;
    } finally {
        in.close();
    }
}
 
Example 5
Source File: StreamHeader12.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_2_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            } else if (SOAP_1_2_RELAY.equals(localName)) {
                _isRelay = Util.parseBool(value);
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 6
Source File: StreamHeader11.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_ACTOR_NEXT;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_1_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_1_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 7
Source File: ContextFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Look for jaxb.index file in the specified package and load it's contents
 *
 * @param pkg package name to search in
 * @param classLoader ClassLoader to search in
 * @return a List of Class objects to load, null if there weren't any
 * @throws IOException if there is an error reading the index file
 * @throws JAXBException if there are any errors in the index file
 */
private static List<Class> loadIndexedClasses(String pkg, ClassLoader classLoader) throws IOException, JAXBException {
    final String resource = pkg.replace('.', '/') + "/jaxb.index";
    final InputStream resourceAsStream = classLoader.getResourceAsStream(resource);

    if (resourceAsStream == null) {
        return null;
    }

    BufferedReader in =
            new BufferedReader(new InputStreamReader(resourceAsStream, "UTF-8"));
    try {
        FinalArrayList<Class> classes = new FinalArrayList<Class>();
        String className = in.readLine();
        while (className != null) {
            className = className.trim();
            if (className.startsWith("#") || (className.length() == 0)) {
                className = in.readLine();
                continue;
            }

            if (className.endsWith(".class")) {
                throw new JAXBException(Messages.ILLEGAL_ENTRY.format(className));
            }

            try {
                classes.add(classLoader.loadClass(pkg + '.' + className));
            } catch (ClassNotFoundException e) {
                throw new JAXBException(Messages.ERROR_LOADING_CLASS.format(className, resource),e);
            }

            className = in.readLine();
        }
        return classes;
    } finally {
        in.close();
    }
}
 
Example 8
Source File: StreamHeader12.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_2_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            } else if (SOAP_1_2_RELAY.equals(localName)) {
                _isRelay = Util.parseBool(value);
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 9
Source File: StreamHeader11.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_ACTOR_NEXT;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_1_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_1_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 10
Source File: ContextFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Look for jaxb.index file in the specified package and load it's contents
 *
 * @param pkg package name to search in
 * @param classLoader ClassLoader to search in
 * @return a List of Class objects to load, null if there weren't any
 * @throws IOException if there is an error reading the index file
 * @throws JAXBException if there are any errors in the index file
 */
private static List<Class> loadIndexedClasses(String pkg, ClassLoader classLoader) throws IOException, JAXBException {
    final String resource = pkg.replace('.', '/') + "/jaxb.index";
    final InputStream resourceAsStream = classLoader.getResourceAsStream(resource);

    if (resourceAsStream == null) {
        return null;
    }

    BufferedReader in =
            new BufferedReader(new InputStreamReader(resourceAsStream, "UTF-8"));
    try {
        FinalArrayList<Class> classes = new FinalArrayList<Class>();
        String className = in.readLine();
        while (className != null) {
            className = className.trim();
            if (className.startsWith("#") || (className.length() == 0)) {
                className = in.readLine();
                continue;
            }

            if (className.endsWith(".class")) {
                throw new JAXBException(Messages.ILLEGAL_ENTRY.format(className));
            }

            try {
                classes.add(classLoader.loadClass(pkg + '.' + className));
            } catch (ClassNotFoundException e) {
                throw new JAXBException(Messages.ERROR_LOADING_CLASS.format(className, resource),e);
            }

            className = in.readLine();
        }
        return classes;
    } finally {
        in.close();
    }
}
 
Example 11
Source File: StreamHeader12.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_2_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            } else if (SOAP_1_2_RELAY.equals(localName)) {
                _isRelay = Util.parseBool(value);
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 12
Source File: StreamHeader11.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_ACTOR_NEXT;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_1_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_1_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 13
Source File: ContextFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Look for jaxb.index file in the specified package and load it's contents
 *
 * @param pkg package name to search in
 * @param classLoader ClassLoader to search in
 * @return a List of Class objects to load, null if there weren't any
 * @throws IOException if there is an error reading the index file
 * @throws JAXBException if there are any errors in the index file
 */
private static List<Class> loadIndexedClasses(String pkg, ClassLoader classLoader) throws IOException, JAXBException {
    final String resource = pkg.replace('.', '/') + "/jaxb.index";
    final InputStream resourceAsStream = classLoader.getResourceAsStream(resource);

    if (resourceAsStream == null) {
        return null;
    }

    BufferedReader in =
            new BufferedReader(new InputStreamReader(resourceAsStream, "UTF-8"));
    try {
        FinalArrayList<Class> classes = new FinalArrayList<Class>();
        String className = in.readLine();
        while (className != null) {
            className = className.trim();
            if (className.startsWith("#") || (className.length() == 0)) {
                className = in.readLine();
                continue;
            }

            if (className.endsWith(".class")) {
                throw new JAXBException(Messages.ILLEGAL_ENTRY.format(className));
            }

            try {
                classes.add(classLoader.loadClass(pkg + '.' + className));
            } catch (ClassNotFoundException e) {
                throw new JAXBException(Messages.ERROR_LOADING_CLASS.format(className, resource),e);
            }

            className = in.readLine();
        }
        return classes;
    } finally {
        in.close();
    }
}
 
Example 14
Source File: StreamHeader12.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_2_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            } else if (SOAP_1_2_RELAY.equals(localName)) {
                _isRelay = Util.parseBool(value);
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 15
Source File: StreamHeader11.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_ACTOR_NEXT;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_1_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_1_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 16
Source File: ContextFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Look for jaxb.index file in the specified package and load it's contents
 *
 * @param pkg package name to search in
 * @param classLoader ClassLoader to search in
 * @return a List of Class objects to load, null if there weren't any
 * @throws IOException if there is an error reading the index file
 * @throws JAXBException if there are any errors in the index file
 */
private static List<Class> loadIndexedClasses(String pkg, ClassLoader classLoader) throws IOException, JAXBException {
    final String resource = pkg.replace('.', '/') + "/jaxb.index";
    final InputStream resourceAsStream = classLoader.getResourceAsStream(resource);

    if (resourceAsStream == null) {
        return null;
    }

    BufferedReader in =
            new BufferedReader(new InputStreamReader(resourceAsStream, "UTF-8"));
    try {
        FinalArrayList<Class> classes = new FinalArrayList<Class>();
        String className = in.readLine();
        while (className != null) {
            className = className.trim();
            if (className.startsWith("#") || (className.length() == 0)) {
                className = in.readLine();
                continue;
            }

            if (className.endsWith(".class")) {
                throw new JAXBException(Messages.ILLEGAL_ENTRY.format(className));
            }

            try {
                classes.add(classLoader.loadClass(pkg + '.' + className));
            } catch (ClassNotFoundException e) {
                throw new JAXBException(Messages.ERROR_LOADING_CLASS.format(className, resource),e);
            }

            className = in.readLine();
        }
        return classes;
    } finally {
        in.close();
    }
}
 
Example 17
Source File: StreamHeader12.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_2_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            } else if (SOAP_1_2_RELAY.equals(localName)) {
                _isRelay = Util.parseBool(value);
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 18
Source File: StreamHeader11.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_ACTOR_NEXT;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_1_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_1_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}
 
Example 19
Source File: ContextFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Look for jaxb.index file in the specified package and load it's contents
 *
 * @param pkg package name to search in
 * @param classLoader ClassLoader to search in
 * @return a List of Class objects to load, null if there weren't any
 * @throws IOException if there is an error reading the index file
 * @throws JAXBException if there are any errors in the index file
 */
private static List<Class> loadIndexedClasses(String pkg, ClassLoader classLoader) throws IOException, JAXBException {
    final String resource = pkg.replace('.', '/') + "/jaxb.index";
    final InputStream resourceAsStream = classLoader.getResourceAsStream(resource);

    if (resourceAsStream == null) {
        return null;
    }

    BufferedReader in =
            new BufferedReader(new InputStreamReader(resourceAsStream, "UTF-8"));
    try {
        FinalArrayList<Class> classes = new FinalArrayList<Class>();
        String className = in.readLine();
        while (className != null) {
            className = className.trim();
            if (className.startsWith("#") || (className.length() == 0)) {
                className = in.readLine();
                continue;
            }

            if (className.endsWith(".class")) {
                throw new JAXBException(Messages.ILLEGAL_ENTRY.format(className));
            }

            try {
                classes.add(classLoader.loadClass(pkg + '.' + className));
            } catch (ClassNotFoundException e) {
                throw new JAXBException(Messages.ERROR_LOADING_CLASS.format(className, resource),e);
            }

            className = in.readLine();
        }
        return classes;
    } finally {
        in.close();
    }
}
 
Example 20
Source File: StreamHeader12.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
    FinalArrayList<Attribute> atts = null;

    _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final String localName = reader.getAttributeLocalName(i);
        final String namespaceURI = reader.getAttributeNamespace(i);
        final String value = reader.getAttributeValue(i);

        if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
            if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
                _isMustUnderstand = Util.parseBool(value);
            } else if (SOAP_1_2_ROLE.equals(localName)) {
                if (value != null && value.length() > 0) {
                    _role = value;
                }
            } else if (SOAP_1_2_RELAY.equals(localName)) {
                _isRelay = Util.parseBool(value);
            }
        }

        if(atts==null) {
            atts = new FinalArrayList<Attribute>();
        }
        atts.add(new Attribute(namespaceURI,localName,value));
    }

    return atts;
}