equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
54 * @return |
54 * @return |
55 * A new instance of a {@code JAXBContext}. |
55 * A new instance of a {@code JAXBContext}. |
56 * |
56 * |
57 * @throws JAXBException |
57 * @throws JAXBException |
58 * if an error was encountered while creating the |
58 * if an error was encountered while creating the |
59 * {@code JAXBContext}, such as (but not limited to): |
59 * {@code JAXBContext}. See {@link JAXBContext#newInstance(Class[], Map)} for details. |
60 * <ol> |
|
61 * <li>Classes use JAXB annotations incorrectly |
|
62 * <li>Classes have colliding annotations (i.e., two classes with the same type name) |
|
63 * <li>The JAXB implementation was unable to locate |
|
64 * provider-specific out-of-band information (such as additional |
|
65 * files generated at the development time.) |
|
66 * </ol> |
|
67 * |
60 * |
68 * @throws IllegalArgumentException |
61 * @throws IllegalArgumentException |
69 * if the parameter contains {@code null} (i.e., {@code newInstance(null,someMap);}) |
62 * if the parameter contains {@code null} (i.e., {@code newInstance(null,someMap);}) |
70 * |
63 * |
71 * @since 9, JAXB 2.3 |
64 * @since 9, JAXB 2.3 |
79 * |
72 * |
80 * <p> |
73 * <p> |
81 * For semantics see {@link javax.xml.bind.JAXBContext#newInstance(String, ClassLoader, java.util.Map)} |
74 * For semantics see {@link javax.xml.bind.JAXBContext#newInstance(String, ClassLoader, java.util.Map)} |
82 * |
75 * |
83 * <p> |
76 * <p> |
84 * The interpretation of properties is up to implementations. Implementations should |
77 * The interpretation of properties is up to implementations. Implementations must |
85 * throw {@code JAXBException} if it finds properties that it doesn't understand. |
78 * throw {@code JAXBException} if it finds properties that it doesn't understand. |
86 * |
79 * |
87 * @param contextPath list of java package names that contain schema derived classes |
80 * @param contextPath list of java package names that contain schema derived classes |
88 * @param classLoader |
81 * @param classLoader |
89 * This class loader will be used to locate the implementation classes. |
82 * This class loader will be used to locate the implementation classes. |
91 * provider-specific properties. Can be null, which means the same thing as passing |
84 * provider-specific properties. Can be null, which means the same thing as passing |
92 * in an empty map. |
85 * in an empty map. |
93 * |
86 * |
94 * @return a new instance of a {@code JAXBContext} |
87 * @return a new instance of a {@code JAXBContext} |
95 * @throws JAXBException if an error was encountered while creating the |
88 * @throws JAXBException if an error was encountered while creating the |
96 * {@code JAXBContext} such as |
89 * {@code JAXBContext}. See {@link JAXBContext#newInstance(String, ClassLoader, Map)} for details. |
97 * <ol> |
90 * |
98 * <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li> |
|
99 * <li>an ambiguity among global elements contained in the contextPath</li> |
|
100 * <li>failure to locate a value for the context factory provider property</li> |
|
101 * <li>mixing schema derived packages from different providers on the same contextPath</li> |
|
102 * </ol> |
|
103 * @since 9, JAXB 2.3 |
91 * @since 9, JAXB 2.3 |
104 */ |
92 */ |
105 JAXBContext createContext(String contextPath, |
93 JAXBContext createContext(String contextPath, |
106 ClassLoader classLoader, |
94 ClassLoader classLoader, |
107 Map<String, ?> properties ) throws JAXBException; |
95 Map<String, ?> properties ) throws JAXBException; |