1 5 6 package javax.xml.bind; 7 8 import org.w3c.dom.Node ; 9 10 import java.util.Collections ; 11 import java.util.Map ; 12 import java.io.IOException ; 13 14 206 public abstract class JAXBContext { 207 208 212 public static final String JAXB_CONTEXT_FACTORY = 213 "javax.xml.bind.context.factory"; 214 215 216 protected JAXBContext() { 217 } 218 219 220 240 public static JAXBContext newInstance( String contextPath ) 241 throws JAXBException { 242 243 return newInstance( contextPath, Thread.currentThread().getContextClassLoader() ); 245 } 246 247 335 public static JAXBContext newInstance( String contextPath, ClassLoader classLoader ) throws JAXBException { 336 337 return newInstance(contextPath,classLoader,Collections.<String ,Object >emptyMap()); 338 } 339 340 369 public static JAXBContext newInstance( String contextPath, ClassLoader classLoader, Map <String ,?> properties ) 370 throws JAXBException { 371 372 return ContextFinder.find( 373 374 JAXB_CONTEXT_FACTORY, 375 376 377 contextPath, 378 379 380 classLoader, 381 properties ); 382 } 383 384 459 519 public static JAXBContext newInstance( Class ... classesToBeBound ) 520 throws JAXBException { 521 522 return newInstance(classesToBeBound,Collections.<String ,Object >emptyMap()); 523 } 524 525 561 public static JAXBContext newInstance( Class [] classesToBeBound, Map <String ,?> properties ) 562 throws JAXBException { 563 564 569 for( int i=classesToBeBound.length-1; i>=0; i-- ) 571 if(classesToBeBound[i]==null) 572 throw new IllegalArgumentException (); 573 574 return ContextFinder.find(classesToBeBound,properties); 575 } 576 577 586 public abstract Unmarshaller createUnmarshaller() throws JAXBException; 587 588 589 598 public abstract Marshaller createMarshaller() throws JAXBException; 599 600 601 614 public abstract Validator createValidator() throws JAXBException; 615 616 630 public <T> Binder<T> createBinder(Class <T> domType) { 631 throw new UnsupportedOperationException (); 634 } 635 636 643 public Binder<Node > createBinder() { 644 return createBinder(Node .class); 645 } 646 647 660 public JAXBIntrospector createJAXBIntrospector() { 661 throw new UnsupportedOperationException (); 664 } 665 666 682 public void generateSchema(SchemaOutputResolver outputResolver) throws IOException { 683 throw new UnsupportedOperationException (); 686 } 687 } 688 | Popular Tags |