Java Code Examples for com.sun.tools.internal.xjc.model.TypeUseFactory#adapt()
The following examples show how to use
com.sun.tools.internal.xjc.model.TypeUseFactory#adapt() .
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: BIConversion.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); JDefinedClass a; try { a = cm._class(adapter); a.hide(); // we assume this is given by the user a._extends(cm.ref(XmlAdapter.class).narrow(String.class).narrow( cm.ref(type))); } catch (JClassAlreadyExistsException e) { a = e.getExistingClass(); } // TODO: it's not correct to say that it adapts from String, // but OTOH I don't think we can compute that. typeUse = TypeUseFactory.adapt( CBuiltinLeafInfo.STRING, new CAdapter(a)); return typeUse; }
Example 2
Source File: BIConversion.java From hottub with GNU General Public License v2.0 | 6 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); JDefinedClass a; try { a = cm._class(adapter); a.hide(); // we assume this is given by the user a._extends(cm.ref(XmlAdapter.class).narrow(String.class).narrow( cm.ref(type))); } catch (JClassAlreadyExistsException e) { a = e.getExistingClass(); } // TODO: it's not correct to say that it adapts from String, // but OTOH I don't think we can compute that. typeUse = TypeUseFactory.adapt( CBuiltinLeafInfo.STRING, new CAdapter(a)); return typeUse; }
Example 3
Source File: BIConversion.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); JDefinedClass a; try { a = cm._class(adapter); a.hide(); // we assume this is given by the user a._extends(cm.ref(XmlAdapter.class).narrow(String.class).narrow( cm.ref(type))); } catch (JClassAlreadyExistsException e) { a = e.getExistingClass(); } // TODO: it's not correct to say that it adapts from String, // but OTOH I don't think we can compute that. typeUse = TypeUseFactory.adapt( CBuiltinLeafInfo.STRING, new CAdapter(a)); return typeUse; }
Example 4
Source File: BIConversion.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); JDefinedClass a; try { a = cm._class(adapter); a.hide(); // we assume this is given by the user a._extends(cm.ref(XmlAdapter.class).narrow(String.class).narrow( cm.ref(type))); } catch (JClassAlreadyExistsException e) { a = e.getExistingClass(); } // TODO: it's not correct to say that it adapts from String, // but OTOH I don't think we can compute that. typeUse = TypeUseFactory.adapt( CBuiltinLeafInfo.STRING, new CAdapter(a)); return typeUse; }
Example 5
Source File: BIConversion.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); JDefinedClass a; try { a = cm._class(adapter); a.hide(); // we assume this is given by the user a._extends(cm.ref(XmlAdapter.class).narrow(String.class).narrow( cm.ref(type))); } catch (JClassAlreadyExistsException e) { a = e.getExistingClass(); } // TODO: it's not correct to say that it adapts from String, // but OTOH I don't think we can compute that. typeUse = TypeUseFactory.adapt( CBuiltinLeafInfo.STRING, new CAdapter(a)); return typeUse; }
Example 6
Source File: BIConversion.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); JDefinedClass a; try { a = cm._class(adapter); a.hide(); // we assume this is given by the user a._extends(cm.ref(XmlAdapter.class).narrow(String.class).narrow( cm.ref(type))); } catch (JClassAlreadyExistsException e) { a = e.getExistingClass(); } // TODO: it's not correct to say that it adapts from String, // but OTOH I don't think we can compute that. typeUse = TypeUseFactory.adapt( CBuiltinLeafInfo.STRING, new CAdapter(a)); return typeUse; }
Example 7
Source File: ElementMappingImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
protected ElementMappingImpl(JAXBModelImpl parent, CElementInfo elementInfo) { super(parent,elementInfo); TypeUse t = clazz.getContentType(); if(clazz.getProperty().isCollection()) t = TypeUseFactory.makeCollection(t); CAdapter a = clazz.getProperty().getAdapter(); if(a!=null) t = TypeUseFactory.adapt(t,a); taa = new TypeAndAnnotationImpl(parent.outline,t); }
Example 8
Source File: ElementMappingImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
protected ElementMappingImpl(JAXBModelImpl parent, CElementInfo elementInfo) { super(parent,elementInfo); TypeUse t = clazz.getContentType(); if(clazz.getProperty().isCollection()) t = TypeUseFactory.makeCollection(t); CAdapter a = clazz.getProperty().getAdapter(); if(a!=null) t = TypeUseFactory.adapt(t,a); taa = new TypeAndAnnotationImpl(parent.outline,t); }
Example 9
Source File: ElementMappingImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
protected ElementMappingImpl(JAXBModelImpl parent, CElementInfo elementInfo) { super(parent,elementInfo); TypeUse t = clazz.getContentType(); if(clazz.getProperty().isCollection()) t = TypeUseFactory.makeCollection(t); CAdapter a = clazz.getProperty().getAdapter(); if(a!=null) t = TypeUseFactory.adapt(t,a); taa = new TypeAndAnnotationImpl(parent.outline,t); }
Example 10
Source File: ElementMappingImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
protected ElementMappingImpl(JAXBModelImpl parent, CElementInfo elementInfo) { super(parent,elementInfo); TypeUse t = clazz.getContentType(); if(clazz.getProperty().isCollection()) t = TypeUseFactory.makeCollection(t); CAdapter a = clazz.getProperty().getAdapter(); if(a!=null) t = TypeUseFactory.adapt(t,a); taa = new TypeAndAnnotationImpl(parent.outline,t); }
Example 11
Source File: ElementMappingImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
protected ElementMappingImpl(JAXBModelImpl parent, CElementInfo elementInfo) { super(parent,elementInfo); TypeUse t = clazz.getContentType(); if(clazz.getProperty().isCollection()) t = TypeUseFactory.makeCollection(t); CAdapter a = clazz.getProperty().getAdapter(); if(a!=null) t = TypeUseFactory.adapt(t,a); taa = new TypeAndAnnotationImpl(parent.outline,t); }
Example 12
Source File: ElementMappingImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
protected ElementMappingImpl(JAXBModelImpl parent, CElementInfo elementInfo) { super(parent,elementInfo); TypeUse t = clazz.getContentType(); if(clazz.getProperty().isCollection()) t = TypeUseFactory.makeCollection(t); CAdapter a = clazz.getProperty().getAdapter(); if(a!=null) t = TypeUseFactory.adapt(t,a); taa = new TypeAndAnnotationImpl(parent.outline,t); }
Example 13
Source File: BIConversion.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); if(inMemoryType==null) inMemoryType = TypeUtil.getType(cm,type,Ring.get(ErrorReceiver.class),getLocation()); JDefinedClass adapter = generateAdapter(parseMethodFor(owner),printMethodFor(owner),owner); // XmlJavaType customization always converts between string and an user-defined type. typeUse = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(adapter)); return typeUse; }
Example 14
Source File: BIConversion.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); if(inMemoryType==null) inMemoryType = TypeUtil.getType(cm,type,Ring.get(ErrorReceiver.class),getLocation()); JDefinedClass adapter = generateAdapter(parseMethodFor(owner),printMethodFor(owner),owner); // XmlJavaType customization always converts between string and an user-defined type. typeUse = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(adapter)); return typeUse; }
Example 15
Source File: BIConversion.java From hottub with GNU General Public License v2.0 | 4 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); if(inMemoryType==null) inMemoryType = TypeUtil.getType(cm,type,Ring.get(ErrorReceiver.class),getLocation()); JDefinedClass adapter = generateAdapter(parseMethodFor(owner),printMethodFor(owner),owner); // XmlJavaType customization always converts between string and an user-defined type. typeUse = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(adapter)); return typeUse; }
Example 16
Source File: BIConversion.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); if(inMemoryType==null) inMemoryType = TypeUtil.getType(cm,type,Ring.get(ErrorReceiver.class),getLocation()); JDefinedClass adapter = generateAdapter(parseMethodFor(owner),printMethodFor(owner),owner); // XmlJavaType customization always converts between string and an user-defined type. typeUse = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(adapter)); return typeUse; }
Example 17
Source File: BIConversion.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); if(inMemoryType==null) inMemoryType = TypeUtil.getType(cm,type,Ring.get(ErrorReceiver.class),getLocation()); JDefinedClass adapter = generateAdapter(parseMethodFor(owner),printMethodFor(owner),owner); // XmlJavaType customization always converts between string and an user-defined type. typeUse = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(adapter)); return typeUse; }
Example 18
Source File: BIConversion.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); if(inMemoryType==null) inMemoryType = TypeUtil.getType(cm,type,Ring.get(ErrorReceiver.class),getLocation()); JDefinedClass adapter = generateAdapter(parseMethodFor(owner),printMethodFor(owner),owner); // XmlJavaType customization always converts between string and an user-defined type. typeUse = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(adapter)); return typeUse; }
Example 19
Source File: BIConversion.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); if(inMemoryType==null) inMemoryType = TypeUtil.getType(cm,type,Ring.get(ErrorReceiver.class),getLocation()); JDefinedClass adapter = generateAdapter(parseMethodFor(owner),printMethodFor(owner),owner); // XmlJavaType customization always converts between string and an user-defined type. typeUse = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(adapter)); return typeUse; }
Example 20
Source File: BIConversion.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public TypeUse getTypeUse(XSSimpleType owner) { if(typeUse!=null) return typeUse; JCodeModel cm = getCodeModel(); if(inMemoryType==null) inMemoryType = TypeUtil.getType(cm,type,Ring.get(ErrorReceiver.class),getLocation()); JDefinedClass adapter = generateAdapter(parseMethodFor(owner),printMethodFor(owner),owner); // XmlJavaType customization always converts between string and an user-defined type. typeUse = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(adapter)); return typeUse; }