/** * Creates a {@link RuntimeTypeInfoSet}. */ public RuntimeTypeInfoSet getTypeInfoSet() throws IllegalAnnotationsException { // check cache if(typeInfoSetCache!=null) { RuntimeTypeInfoSet r = typeInfoSetCache.get(); if(r!=null) return r; } final RuntimeModelBuilder builder = new RuntimeModelBuilder(this,annotationReader,subclassReplacements,defaultNsUri); IllegalAnnotationsException.Builder errorHandler = new IllegalAnnotationsException.Builder(); builder.setErrorHandler(errorHandler); for( Class c : classes ) { if(c==CompositeStructure.class) // CompositeStructure doesn't have TypeInfo, so skip it. // We'll add JaxBeanInfo for this later automatically continue; builder.getTypeInfo(new Ref<Type,Class>(c)); } this.hasSwaRef |= builder.hasSwaRef; RuntimeTypeInfoSet r = builder.link(); errorHandler.check(); assert r!=null : "if no error was reported, the link must be a success"; typeInfoSetCache = new WeakReference<RuntimeTypeInfoSet>(r); return r; }
/** * Creates a {@link RuntimeTypeInfoSet}. */ public RuntimeTypeInfoSet getTypeInfoSet() throws IllegalAnnotationsException { // check cache if(typeInfoSetCache!=null) { RuntimeTypeInfoSet r = typeInfoSetCache.get(); if(r!=null) return r; } final RuntimeModelBuilder builder = new RuntimeModelBuilder(this,annotationReader,subclassReplacements,defaultNsUri); IllegalAnnotationsException.Builder errorHandler = new IllegalAnnotationsException.Builder(); builder.setErrorHandler(errorHandler); for( Class c : classes ) { if(c==CompositeStructure.class) // CompositeStructure doesn't have TypeInfo, so skip it. // We'll add JaxBeanInfo for this later automatically continue; builder.getTypeInfo(new Ref<Type,Class>(c)); } this.hasSwaRef |= builder.hasSwaRef; RuntimeTypeInfoSet r = builder.link(); errorHandler.check(); assert r!=null : "if no error was reported, the link must be a success"; typeInfoSetCache = new WeakReference<RuntimeTypeInfoSet>(r); return r; }
/** * Creates a {@link RuntimeTypeInfoSet}. */ public RuntimeTypeInfoSet getTypeInfoSet() throws IllegalAnnotationsException { // check cache if(typeInfoSetCache!=null) { RuntimeTypeInfoSet r = typeInfoSetCache.get(); if(r!=null) return r; } final RuntimeModelBuilder builder = new RuntimeModelBuilder(this,annotationReader,subclassReplacements,defaultNsUri); IllegalAnnotationsException.Builder errorHandler = new IllegalAnnotationsException.Builder(); builder.setErrorHandler(errorHandler); for( Class c : classes ) { if(c==CompositeStructure.class) // CompositeStructure doesn't have TypeInfo, so skip it. // We'll add JaxBeanInfo for this later automatically continue; builder.getTypeInfo(new Ref<Type,Class>(c)); } this.hasSwaRef |= builder.hasSwaRef; RuntimeTypeInfoSet r = builder.link(); errorHandler.check(); assert r!=null : "if no error was reported, the link must be a success"; typeInfoSetCache = new WeakReference<RuntimeTypeInfoSet>(r); return r; }
/** * Creates a new JAXB model from classes represented in * <tt>java.lang.reflect</tt>. * <p> * This version reads annotations from the classes directly, and throw any * error reported as an exception * * @return null if any error was reported during the processing. If no error * is reported, a non-null valid object. * @throws IllegalAnnotationsException if there was any incorrect use of * annotations in the specified set of classes. */ public static RuntimeTypeInfoSet create(JAXBContextImpl context, Class... classes) throws IllegalAnnotationsException { IllegalAnnotationsException.Builder errorListener = new IllegalAnnotationsException.Builder(); RuntimeTypeInfoSet r = create(context, errorListener, classes); errorListener.check(); return r; } }
/** * Creates a new JAXB model from classes represented in * <tt>java.lang.reflect</tt>. * <p> * This version reads annotations from the classes directly, and throw any * error reported as an exception * * @return null if any error was reported during the processing. If no error * is reported, a non-null valid object. * @throws IllegalAnnotationsException if there was any incorrect use of * annotations in the specified set of classes. */ public static RuntimeTypeInfoSet create(JAXBContextImpl context, Class... classes) throws IllegalAnnotationsException { IllegalAnnotationsException.Builder errorListener = new IllegalAnnotationsException.Builder(); RuntimeTypeInfoSet r = create(context, errorListener, classes); errorListener.check(); return r; } }
/** * Creates a {@link RuntimeTypeInfoSet}. */ public RuntimeTypeInfoSet getTypeInfoSet() throws IllegalAnnotationsException { // check cache if(typeInfoSetCache!=null) { RuntimeTypeInfoSet r = typeInfoSetCache.get(); if(r!=null) return r; } final RuntimeModelBuilder builder = new RuntimeModelBuilder(this,annotationReader,subclassReplacements,defaultNsUri); IllegalAnnotationsException.Builder errorHandler = new IllegalAnnotationsException.Builder(); builder.setErrorHandler(errorHandler); for( Class c : classes ) { if(c==CompositeStructure.class) // CompositeStructure doesn't have TypeInfo, so skip it. // We'll add JaxBeanInfo for this later automatically continue; builder.getTypeInfo(new Ref<Type,Class>(c)); } this.hasSwaRef |= builder.hasSwaRef; RuntimeTypeInfoSet r = builder.link(); errorHandler.check(); assert r!=null : "if no error was reported, the link must be a success"; typeInfoSetCache = new WeakReference<RuntimeTypeInfoSet>(r); return r; }