com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet Java Examples
The following examples show how to use
com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JAXBContextImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
private XmlSchemaGenerator<Type,Class,Field,Method> createSchemaGenerator() { RuntimeTypeInfoSet tis; try { tis = getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // this shouldn't happen because we've already throw new AssertionError(e); } XmlSchemaGenerator<Type,Class,Field,Method> xsdgen = new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis); // JAX-RPC uses Bridge objects that collide with // @XmlRootElement. // we will avoid collision here Set<QName> rootTagNames = new HashSet<QName>(); for (RuntimeElementInfo ei : tis.getAllElements()) { rootTagNames.add(ei.getElementName()); } for (RuntimeClassInfo ci : tis.beans().values()) { if(ci.isElement()) rootTagNames.add(ci.asElement().getElementName()); } for (TypeReference tr : bridges.keySet()) { if(rootTagNames.contains(tr.tagName)) continue; if(tr.type==void.class || tr.type==Void.class) { xsdgen.add(tr.tagName,false,null); } else if(tr.type==CompositeStructure.class) { // this is a special class we introduced for JAX-WS that we *don't* want in the schema } else { NonElement<Type,Class> typeInfo = getXmlType(tis,tr); xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo); } } return xsdgen; }
Example #2
Source File: JAXBContextImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #3
Source File: JAXBContextImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private XmlSchemaGenerator<Type,Class,Field,Method> createSchemaGenerator() { RuntimeTypeInfoSet tis; try { tis = getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // this shouldn't happen because we've already throw new AssertionError(e); } XmlSchemaGenerator<Type,Class,Field,Method> xsdgen = new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis); // JAX-RPC uses Bridge objects that collide with // @XmlRootElement. // we will avoid collision here Set<QName> rootTagNames = new HashSet<QName>(); for (RuntimeElementInfo ei : tis.getAllElements()) { rootTagNames.add(ei.getElementName()); } for (RuntimeClassInfo ci : tis.beans().values()) { if(ci.isElement()) rootTagNames.add(ci.asElement().getElementName()); } for (TypeReference tr : bridges.keySet()) { if(rootTagNames.contains(tr.tagName)) continue; if(tr.type==void.class || tr.type==Void.class) { xsdgen.add(tr.tagName,false,null); } else if(tr.type==CompositeStructure.class) { // this is a special class we introduced for JAX-WS that we *don't* want in the schema } else { NonElement<Type,Class> typeInfo = getXmlType(tis,tr); xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo); } } return xsdgen; }
Example #4
Source File: JAXBContextImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * 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; }
Example #5
Source File: JAXBContextImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { try { return getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // impossible, once the model is constructred throw new AssertionError(e); } }
Example #6
Source File: JAXBContextImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { try { return getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // impossible, once the model is constructred throw new AssertionError(e); } }
Example #7
Source File: JAXBContextImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * 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; }
Example #8
Source File: JAXBContextImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #9
Source File: JAXBContextImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private XmlSchemaGenerator<Type,Class,Field,Method> createSchemaGenerator() { RuntimeTypeInfoSet tis; try { tis = getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // this shouldn't happen because we've already throw new AssertionError(e); } XmlSchemaGenerator<Type,Class,Field,Method> xsdgen = new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis); // JAX-RPC uses Bridge objects that collide with // @XmlRootElement. // we will avoid collision here Set<QName> rootTagNames = new HashSet<QName>(); for (RuntimeElementInfo ei : tis.getAllElements()) { rootTagNames.add(ei.getElementName()); } for (RuntimeClassInfo ci : tis.beans().values()) { if(ci.isElement()) rootTagNames.add(ci.asElement().getElementName()); } for (TypeReference tr : bridges.keySet()) { if(rootTagNames.contains(tr.tagName)) continue; if(tr.type==void.class || tr.type==Void.class) { xsdgen.add(tr.tagName,false,null); } else if(tr.type==CompositeStructure.class) { // this is a special class we introduced for JAX-WS that we *don't* want in the schema } else { NonElement<Type,Class> typeInfo = getXmlType(tis,tr); xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo); } } return xsdgen; }
Example #10
Source File: JAXBContextImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * 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; }
Example #11
Source File: JAXBContextImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #12
Source File: JAXBContextImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { try { return getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // impossible, once the model is constructred throw new AssertionError(e); } }
Example #13
Source File: JAXBContextImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * 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; }
Example #14
Source File: JAXBContextImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #15
Source File: JAXBContextImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private XmlSchemaGenerator<Type,Class,Field,Method> createSchemaGenerator() { RuntimeTypeInfoSet tis; try { tis = getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // this shouldn't happen because we've already throw new AssertionError(e); } XmlSchemaGenerator<Type,Class,Field,Method> xsdgen = new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis); // JAX-RPC uses Bridge objects that collide with // @XmlRootElement. // we will avoid collision here Set<QName> rootTagNames = new HashSet<QName>(); for (RuntimeElementInfo ei : tis.getAllElements()) { rootTagNames.add(ei.getElementName()); } for (RuntimeClassInfo ci : tis.beans().values()) { if(ci.isElement()) rootTagNames.add(ci.asElement().getElementName()); } for (TypeReference tr : bridges.keySet()) { if(rootTagNames.contains(tr.tagName)) continue; if(tr.type==void.class || tr.type==Void.class) { xsdgen.add(tr.tagName,false,null); } else if(tr.type==CompositeStructure.class) { // this is a special class we introduced for JAX-WS that we *don't* want in the schema } else { NonElement<Type,Class> typeInfo = getXmlType(tis,tr); xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo); } } return xsdgen; }
Example #16
Source File: JAXBContextImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * 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; }
Example #17
Source File: JAXBContextImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { try { return getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // impossible, once the model is constructred throw new AssertionError(e); } }
Example #18
Source File: JAXBContextImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private XmlSchemaGenerator<Type,Class,Field,Method> createSchemaGenerator() { RuntimeTypeInfoSet tis; try { tis = getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // this shouldn't happen because we've already throw new AssertionError(e); } XmlSchemaGenerator<Type,Class,Field,Method> xsdgen = new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis); // JAX-RPC uses Bridge objects that collide with // @XmlRootElement. // we will avoid collision here Set<QName> rootTagNames = new HashSet<QName>(); for (RuntimeElementInfo ei : tis.getAllElements()) { rootTagNames.add(ei.getElementName()); } for (RuntimeClassInfo ci : tis.beans().values()) { if(ci.isElement()) rootTagNames.add(ci.asElement().getElementName()); } for (TypeReference tr : bridges.keySet()) { if(rootTagNames.contains(tr.tagName)) continue; if(tr.type==void.class || tr.type==Void.class) { xsdgen.add(tr.tagName,false,null); } else if(tr.type==CompositeStructure.class) { // this is a special class we introduced for JAX-WS that we *don't* want in the schema } else { NonElement<Type,Class> typeInfo = getXmlType(tis,tr); xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo); } } return xsdgen; }
Example #19
Source File: JAXBContextImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #20
Source File: JAXBContextImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private XmlSchemaGenerator<Type,Class,Field,Method> createSchemaGenerator() { RuntimeTypeInfoSet tis; try { tis = getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // this shouldn't happen because we've already throw new AssertionError(e); } XmlSchemaGenerator<Type,Class,Field,Method> xsdgen = new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis); // JAX-RPC uses Bridge objects that collide with // @XmlRootElement. // we will avoid collision here Set<QName> rootTagNames = new HashSet<QName>(); for (RuntimeElementInfo ei : tis.getAllElements()) { rootTagNames.add(ei.getElementName()); } for (RuntimeClassInfo ci : tis.beans().values()) { if(ci.isElement()) rootTagNames.add(ci.asElement().getElementName()); } for (TypeReference tr : bridges.keySet()) { if(rootTagNames.contains(tr.tagName)) continue; if(tr.type==void.class || tr.type==Void.class) { xsdgen.add(tr.tagName,false,null); } else if(tr.type==CompositeStructure.class) { // this is a special class we introduced for JAX-WS that we *don't* want in the schema } else { NonElement<Type,Class> typeInfo = getXmlType(tis,tr); xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo); } } return xsdgen; }
Example #21
Source File: JAXBContextImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #22
Source File: JAXBContextImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private XmlSchemaGenerator<Type,Class,Field,Method> createSchemaGenerator() { RuntimeTypeInfoSet tis; try { tis = getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // this shouldn't happen because we've already throw new AssertionError(e); } XmlSchemaGenerator<Type,Class,Field,Method> xsdgen = new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis); // JAX-RPC uses Bridge objects that collide with // @XmlRootElement. // we will avoid collision here Set<QName> rootTagNames = new HashSet<QName>(); for (RuntimeElementInfo ei : tis.getAllElements()) { rootTagNames.add(ei.getElementName()); } for (RuntimeClassInfo ci : tis.beans().values()) { if(ci.isElement()) rootTagNames.add(ci.asElement().getElementName()); } for (TypeReference tr : bridges.keySet()) { if(rootTagNames.contains(tr.tagName)) continue; if(tr.type==void.class || tr.type==Void.class) { xsdgen.add(tr.tagName,false,null); } else if(tr.type==CompositeStructure.class) { // this is a special class we introduced for JAX-WS that we *don't* want in the schema } else { NonElement<Type,Class> typeInfo = getXmlType(tis,tr); xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo); } } return xsdgen; }
Example #23
Source File: JAXBContextImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { try { return getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // impossible, once the model is constructred throw new AssertionError(e); } }
Example #24
Source File: JAXBContextImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private NonElement<Type,Class> getXmlType(RuntimeTypeInfoSet tis, TypeReference tr) { if(tr==null) throw new IllegalArgumentException(); XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); XmlList xl = tr.get(XmlList.class); Ref<Type,Class> ref = new Ref<Type,Class>(annotationReader, tis.getNavigator(), tr.type, xjta, xl ); return tis.getTypeInfo(ref); }
Example #25
Source File: JAXBContextImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * 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; }
Example #26
Source File: JAXBContextImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { try { return getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // impossible, once the model is constructred throw new AssertionError(e); } }
Example #27
Source File: JAXBContextImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { try { return getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // impossible, once the model is constructred throw new AssertionError(e); } }
Example #28
Source File: JAXBContextImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * 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; }
Example #29
Source File: JAXBContextImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public RuntimeTypeInfoSet getRuntimeTypeInfoSet() { try { return getTypeInfoSet(); } catch (IllegalAnnotationsException e) { // impossible, once the model is constructred throw new AssertionError(e); } }
Example #30
Source File: JAXBContextImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * 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; }