/** * 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>. * * @param reader used to read annotations from classes. must not be null. * @param errorHandler Receives errors found during the processing. * @return null if any error was reported during the processing. If no error * is reported, a non-null valid object. */ public static RuntimeTypeInfoSet create(JAXBContextImpl context, RuntimeAnnotationReader reader, ErrorHandler errorHandler, Class... classes) { RuntimeModelBuilder builder = new RuntimeModelBuilder(context, reader, new HashMap<Class, Class>(), null); builder.setErrorHandler(errorHandler); for (Class c : classes) builder.getTypeInfo(new Ref<Type, Class>(c)); return builder.link(); }
/** * Creates a new JAXB model from classes represented in * <tt>java.lang.reflect</tt>. * * @param reader used to read annotations from classes. must not be null. * @param errorHandler Receives errors found during the processing. * @return null if any error was reported during the processing. If no error * is reported, a non-null valid object. */ public static RuntimeTypeInfoSet create(JAXBContextImpl context, RuntimeAnnotationReader reader, ErrorHandler errorHandler, Class... classes) { RuntimeModelBuilder builder = new RuntimeModelBuilder(context, reader, new HashMap<Class, Class>(), null); builder.setErrorHandler(errorHandler); for (Class c : classes) builder.getTypeInfo(new Ref<Type, Class>(c)); return builder.link(); }
/** * 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; }