Java Code Examples for com.sun.codemodel.internal.JDefinedClass#hide()
The following examples show how to use
com.sun.codemodel.internal.JDefinedClass#hide() .
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: BindInfo.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superClass customization if it's turned on. */ public JClass getSuperClass() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superClass"); if (sc == null) return null; JDefinedClass c; try { String v = DOMUtil.getAttribute(sc,"name"); if(v==null) return null; c = codeModel._class(v); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 2
Source File: BindInfo.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superInterface customization if it's turned on. */ public JClass getSuperInterface() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superInterface"); if (sc == null) return null; String name = DOMUtil.getAttribute(sc,"name"); if (name == null) return null; JDefinedClass c; try { c = codeModel._class(name, ClassType.INTERFACE); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 3
Source File: BindInfo.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superClass customization if it's turned on. */ public JClass getSuperClass() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superClass"); if (sc == null) return null; JDefinedClass c; try { String v = DOMUtil.getAttribute(sc,"name"); if(v==null) return null; c = codeModel._class(v); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 4
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 5
Source File: BeanGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */ private ClassOutlineImpl generateClassDef(CClassInfo bean) { ImplStructureStrategy.Result r = model.strategy.createClasses(this, bean); JClass implRef; if (bean.getUserSpecifiedImplClass() != null) { // create a place holder for a user-specified class. JDefinedClass usr; try { usr = codeModel._class(bean.getUserSpecifiedImplClass()); // but hide that file so that it won't be generated. usr.hide(); } catch (JClassAlreadyExistsException e) { // it's OK for this to collide. usr = e.getExistingClass(); } usr._extends(r.implementation); implRef = usr; } else { implRef = r.implementation; } return new ClassOutlineImpl(this, bean, r.exposed, r.implementation, implRef); }
Example 6
Source File: BeanGenerator.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */ private ClassOutlineImpl generateClassDef(CClassInfo bean) { ImplStructureStrategy.Result r = model.strategy.createClasses(this, bean); JClass implRef; if (bean.getUserSpecifiedImplClass() != null) { // create a place holder for a user-specified class. JDefinedClass usr; try { usr = codeModel._class(bean.getUserSpecifiedImplClass()); // but hide that file so that it won't be generated. usr.hide(); } catch (JClassAlreadyExistsException e) { // it's OK for this to collide. usr = e.getExistingClass(); } usr._extends(r.implementation); implRef = usr; } else { implRef = r.implementation; } return new ClassOutlineImpl(this, bean, r.exposed, r.implementation, implRef); }
Example 7
Source File: BindInfo.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superClass customization if it's turned on. */ public JClass getSuperClass() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superClass"); if (sc == null) return null; JDefinedClass c; try { String v = DOMUtil.getAttribute(sc,"name"); if(v==null) return null; c = codeModel._class(v); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 8
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 9
Source File: BeanGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */ private ClassOutlineImpl generateClassDef(CClassInfo bean) { ImplStructureStrategy.Result r = model.strategy.createClasses(this, bean); JClass implRef; if (bean.getUserSpecifiedImplClass() != null) { // create a place holder for a user-specified class. JDefinedClass usr; try { usr = codeModel._class(bean.getUserSpecifiedImplClass()); // but hide that file so that it won't be generated. usr.hide(); } catch (JClassAlreadyExistsException e) { // it's OK for this to collide. usr = e.getExistingClass(); } usr._extends(r.implementation); implRef = usr; } else { implRef = r.implementation; } return new ClassOutlineImpl(this, bean, r.exposed, r.implementation, implRef); }
Example 10
Source File: BindInfo.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superInterface customization if it's turned on. */ public JClass getSuperInterface() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superInterface"); if (sc == null) return null; String name = DOMUtil.getAttribute(sc,"name"); if (name == null) return null; JDefinedClass c; try { c = codeModel._class(name, ClassType.INTERFACE); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 11
Source File: BeanGenerator.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */ private ClassOutlineImpl generateClassDef(CClassInfo bean) { ImplStructureStrategy.Result r = model.strategy.createClasses(this, bean); JClass implRef; if (bean.getUserSpecifiedImplClass() != null) { // create a place holder for a user-specified class. JDefinedClass usr; try { usr = codeModel._class(bean.getUserSpecifiedImplClass()); // but hide that file so that it won't be generated. usr.hide(); } catch (JClassAlreadyExistsException e) { // it's OK for this to collide. usr = e.getExistingClass(); } usr._extends(r.implementation); implRef = usr; } else { implRef = r.implementation; } return new ClassOutlineImpl(this, bean, r.exposed, r.implementation, implRef); }
Example 12
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 13
Source File: BindInfo.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superClass customization if it's turned on. */ public JClass getSuperClass() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superClass"); if (sc == null) return null; JDefinedClass c; try { String v = DOMUtil.getAttribute(sc,"name"); if(v==null) return null; c = codeModel._class(v); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 14
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 15
Source File: BindInfo.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superClass customization if it's turned on. */ public JClass getSuperClass() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superClass"); if (sc == null) return null; JDefinedClass c; try { String v = DOMUtil.getAttribute(sc,"name"); if(v==null) return null; c = codeModel._class(v); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 16
Source File: BindInfo.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superInterface customization if it's turned on. */ public JClass getSuperInterface() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superInterface"); if (sc == null) return null; String name = DOMUtil.getAttribute(sc,"name"); if (name == null) return null; JDefinedClass c; try { c = codeModel._class(name, ClassType.INTERFACE); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 17
Source File: BeanGenerator.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */ private ClassOutlineImpl generateClassDef(CClassInfo bean) { ImplStructureStrategy.Result r = model.strategy.createClasses(this, bean); JClass implRef; if (bean.getUserSpecifiedImplClass() != null) { // create a place holder for a user-specified class. JDefinedClass usr; try { usr = codeModel._class(bean.getUserSpecifiedImplClass()); // but hide that file so that it won't be generated. usr.hide(); } catch (JClassAlreadyExistsException e) { // it's OK for this to collide. usr = e.getExistingClass(); } usr._extends(r.implementation); implRef = usr; } else { implRef = r.implementation; } return new ClassOutlineImpl(this, bean, r.exposed, r.implementation, implRef); }
Example 18
Source File: BindInfo.java From hottub with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superClass customization if it's turned on. */ public JClass getSuperClass() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superClass"); if (sc == null) return null; JDefinedClass c; try { String v = DOMUtil.getAttribute(sc,"name"); if(v==null) return null; c = codeModel._class(v); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 19
Source File: BindInfo.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** Gets the xjc:superClass customization if it's turned on. */ public JClass getSuperClass() { Element sc = DOMUtil.getElement(dom,XJC_NS,"superClass"); if (sc == null) return null; JDefinedClass c; try { String v = DOMUtil.getAttribute(sc,"name"); if(v==null) return null; c = codeModel._class(v); c.hide(); } catch (JClassAlreadyExistsException e) { c = e.getExistingClass(); } return c; }
Example 20
Source File: BIConversion.java From TencentKona-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; }