< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java

Print this page


   1 /*
   2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 253      *
 254      * To avoid repeated namespace declarations at sub-elements, the application
 255      * may declare those namespaces at a higher level.
 256      *
 257      * @return
 258      *      always non-null.
 259      *
 260      * @since 2.0 EA2
 261      */
 262     public abstract @NotNull List<String> getKnownNamespaceURIs();
 263 
 264 
 265     /**
 266      * Generates the schema documents from the model.
 267      *
 268      * <p>
 269      * The caller can use the additionalElementDecls parameter to
 270      * add element declarations to the generate schema.
 271      * For example, if the JAX-RPC passes in the following entry:
 272      *
 273      * {foo}bar -> DeclaredType for java.lang.String
 274      *
 275      * then JAXB generates the following element declaration (in the schema
 276      * document for the namespace "foo")"
 277      *
 278      * &lt;xs:element name="bar" type="xs:string" />
 279      *
 280      * This can be used for generating schema components necessary for WSDL.
 281      *
 282      * @param outputResolver
 283      *      this object controls the output to which schemas
 284      *      will be sent.
 285      *
 286      * @throws IOException
 287      *      if {@link SchemaOutputResolver} throws an {@link IOException}.
 288      */
 289     @Override
 290     public abstract void generateSchema(@NotNull SchemaOutputResolver outputResolver) throws IOException;
 291 
 292     /**
 293      * Returns the name of the XML Type bound to the
 294      * specified Java type.
 295      *
 296      * @param tr
 297      *      must not be null. This must be one of the {@link TypeReference}s specified
 298      *      in the {@link JAXBRIContext#newInstance} method.


 419         return Utils.REFLECTION_NAVIGATOR.getBaseClass(type, baseType);
 420     }
 421 
 422     /**
 423      * The property that you can specify to {@link JAXBContext#newInstance}
 424      * to reassign the default namespace URI to something else at the runtime.
 425      *
 426      * <p>
 427      * The value of the property is {@link String}, and it is used as the namespace URI
 428      * that succeeds the default namespace URI.
 429      *
 430      * @since 2.0 EA1
 431      */
 432     public static final String DEFAULT_NAMESPACE_REMAP = "com.sun.xml.internal.bind.defaultNamespaceRemap";
 433 
 434     /**
 435      * The property that you can specify to {@link JAXBContext#newInstance}
 436      * to put additional JAXB type references into the {@link JAXBContext}.
 437      *
 438      * <p>
 439      * The value of the property is {@link Collection}&lt;{@link TypeReference}>.
 440      * Those {@link TypeReference}s can then be used to create {@link Bridge}s.
 441      *
 442      * <p>
 443      * This mechanism allows additional element declarations that were not a part of
 444      * the schema into the created {@link JAXBContext}.
 445      *
 446      * @since 2.0 EA1
 447      */
 448     public static final String TYPE_REFERENCES = "com.sun.xml.internal.bind.typeReferences";
 449 
 450     /**
 451      * The property that you can specify to {@link JAXBContext#newInstance}
 452      * and {@link Marshaller#setProperty(String, Object)}
 453      * to enable the c14n marshalling support in the {@link JAXBContext}.
 454      *
 455      * Boolean
 456      * @see C14nSupport_ArchitectureDocument
 457      * @since 2.0 EA2
 458      */
 459     public static final String CANONICALIZATION_SUPPORT = "com.sun.xml.internal.bind.c14n";
 460 
 461     /**
 462      * The property that you can specify to {@link JAXBContext#newInstance}
 463      * to allow unmarshaller to honor {@code xsi:nil} anywhere, even if they are
 464      * not specifically allowed by the schema.
 465      *
 466      * Boolean
 467      * @since 2.1.3
 468      */
 469     public static final String TREAT_EVERYTHING_NILLABLE = "com.sun.xml.internal.bind.treatEverythingNillable";
 470 
 471     /**
 472      * The property that you can specify to {@link JAXBContext#newInstance}
 473      * to use alternative {@link RuntimeAnnotationReader} implementation.
 474      *
 475      * @since 2.1 EA2
 476      */


   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 253      *
 254      * To avoid repeated namespace declarations at sub-elements, the application
 255      * may declare those namespaces at a higher level.
 256      *
 257      * @return
 258      *      always non-null.
 259      *
 260      * @since 2.0 EA2
 261      */
 262     public abstract @NotNull List<String> getKnownNamespaceURIs();
 263 
 264 
 265     /**
 266      * Generates the schema documents from the model.
 267      *
 268      * <p>
 269      * The caller can use the additionalElementDecls parameter to
 270      * add element declarations to the generate schema.
 271      * For example, if the JAX-RPC passes in the following entry:
 272      *
 273      * {@code {foo}bar -> DeclaredType for java.lang.String}
 274      *
 275      * then JAXB generates the following element declaration (in the schema
 276      * document for the namespace "foo")"
 277      *
 278      * {@code <xs:element name="bar" type="xs:string" />}
 279      *
 280      * This can be used for generating schema components necessary for WSDL.
 281      *
 282      * @param outputResolver
 283      *      this object controls the output to which schemas
 284      *      will be sent.
 285      *
 286      * @throws IOException
 287      *      if {@link SchemaOutputResolver} throws an {@link IOException}.
 288      */
 289     @Override
 290     public abstract void generateSchema(@NotNull SchemaOutputResolver outputResolver) throws IOException;
 291 
 292     /**
 293      * Returns the name of the XML Type bound to the
 294      * specified Java type.
 295      *
 296      * @param tr
 297      *      must not be null. This must be one of the {@link TypeReference}s specified
 298      *      in the {@link JAXBRIContext#newInstance} method.


 419         return Utils.REFLECTION_NAVIGATOR.getBaseClass(type, baseType);
 420     }
 421 
 422     /**
 423      * The property that you can specify to {@link JAXBContext#newInstance}
 424      * to reassign the default namespace URI to something else at the runtime.
 425      *
 426      * <p>
 427      * The value of the property is {@link String}, and it is used as the namespace URI
 428      * that succeeds the default namespace URI.
 429      *
 430      * @since 2.0 EA1
 431      */
 432     public static final String DEFAULT_NAMESPACE_REMAP = "com.sun.xml.internal.bind.defaultNamespaceRemap";
 433 
 434     /**
 435      * The property that you can specify to {@link JAXBContext#newInstance}
 436      * to put additional JAXB type references into the {@link JAXBContext}.
 437      *
 438      * <p>
 439      * The value of the property is {@link Collection}{@code <}{@link TypeReference}{@code >}.
 440      * Those {@link TypeReference}s can then be used to create {@link Bridge}s.
 441      *
 442      * <p>
 443      * This mechanism allows additional element declarations that were not a part of
 444      * the schema into the created {@link JAXBContext}.
 445      *
 446      * @since 2.0 EA1
 447      */
 448     public static final String TYPE_REFERENCES = "com.sun.xml.internal.bind.typeReferences";
 449 
 450     /**
 451      * The property that you can specify to {@link JAXBContext#newInstance}
 452      * and {@link Marshaller#setProperty(String, Object)}
 453      * to enable the c14n marshalling support in the {@link JAXBContext}.
 454      *
 455      * Boolean
 456      * See C14nSupport_ArchitectureDocument in JAXB Architecture Document
 457      * @since 2.0 EA2
 458      */
 459     public static final String CANONICALIZATION_SUPPORT = "com.sun.xml.internal.bind.c14n";
 460 
 461     /**
 462      * The property that you can specify to {@link JAXBContext#newInstance}
 463      * to allow unmarshaller to honor {@code xsi:nil} anywhere, even if they are
 464      * not specifically allowed by the schema.
 465      *
 466      * Boolean
 467      * @since 2.1.3
 468      */
 469     public static final String TREAT_EVERYTHING_NILLABLE = "com.sun.xml.internal.bind.treatEverythingNillable";
 470 
 471     /**
 472      * The property that you can specify to {@link JAXBContext#newInstance}
 473      * to use alternative {@link RuntimeAnnotationReader} implementation.
 474      *
 475      * @since 2.1 EA2
 476      */


< prev index next >