public JPackage _package() { return owner().rootPackage(); }
public JDefinedClass addInterface(final String fullyqualifiedName) throws JClassAlreadyExistsException { if (fullyqualifiedName.indexOf(".") == -1) { return model.rootPackage()._class(JMod.PUBLIC, fullyqualifiedName, ClassType.INTERFACE); } return model._class(fullyqualifiedName, ClassType.INTERFACE); }
public JDefinedClass addInterface(final String fullyqualifiedName) throws JClassAlreadyExistsException { if (fullyqualifiedName.indexOf(".") == -1) { return model.rootPackage()._class(JMod.PUBLIC, fullyqualifiedName, ClassType.INTERFACE); } return model._class(fullyqualifiedName, ClassType.INTERFACE); }
/** * Creates a new generated class. * * @exception JClassAlreadyExistsException * When the specified class/interface was already created. */ public JDefinedClass _class(String fullyqualifiedName,ClassType t) throws JClassAlreadyExistsException { int idx = fullyqualifiedName.lastIndexOf('.'); if( idx<0 ) return rootPackage()._class(fullyqualifiedName); else return _package(fullyqualifiedName.substring(0,idx)) ._class( JMod.PUBLIC, fullyqualifiedName.substring(idx+1), t ); }
public JPackage _package() { int i = fullName.lastIndexOf('.'); if(i>=0) return owner()._package(fullName.substring(0,i)); else return owner().rootPackage(); }
/** * Gets a reference to the already created generated class. * * @return null * If the class is not yet created. * @see JPackage#_getClass(String) */ public JDefinedClass _getClass(String fullyQualifiedName) { int idx = fullyQualifiedName.lastIndexOf('.'); if( idx<0 ) return rootPackage()._getClass(fullyQualifiedName); else return _package(fullyQualifiedName.substring(0,idx)) ._getClass( fullyQualifiedName.substring(idx+1) ); }
public JPackage _package() { int i = fullName.lastIndexOf('.'); if(i>=0) return owner()._package(fullName.substring(0,i)); else return owner().rootPackage(); }
/** * Creates a new generated class. * * @exception JClassAlreadyExistsException * When the specified class/interface was already created. */ public JDefinedClass _class(int mods, String fullyqualifiedName,ClassType t) throws JClassAlreadyExistsException { int idx = fullyqualifiedName.lastIndexOf('.'); if( idx<0 ) return rootPackage()._class(fullyqualifiedName); else return _package(fullyqualifiedName.substring(0,idx)) ._class(mods, fullyqualifiedName.substring(idx+1), t ); }
public JPackage _package() { int i = fullName.lastIndexOf('.'); if(i>=0) return owner()._package(fullName.substring(0,i)); else return owner().rootPackage(); }
/** * Creates a new generated class. * * @exception JClassAlreadyExistsException * When the specified class/interface was already created. */ public JDefinedClass _class(int mods, String fullyqualifiedName,ClassType t) throws JClassAlreadyExistsException { int idx = fullyqualifiedName.lastIndexOf('.'); if( idx<0 ) return rootPackage()._class(fullyqualifiedName); else return _package(fullyqualifiedName.substring(0,idx)) ._class(mods, fullyqualifiedName.substring(idx+1), t ); }
/** * Creates a new generated class. * * @exception JClassAlreadyExistsException * When the specified class/interface was already created. */ public JDefinedClass _class(int mods, String fullyqualifiedName,ClassType t) throws JClassAlreadyExistsException { int idx = fullyqualifiedName.lastIndexOf('.'); if( idx<0 ) return rootPackage()._class(fullyqualifiedName); else return _package(fullyqualifiedName.substring(0,idx)) ._class(mods, fullyqualifiedName.substring(idx+1), t ); }
/** * Creates a new generated class. * * @exception JClassAlreadyExistsException * When the specified class/interface was already created. */ public JDefinedClass _class(int mods, String fullyqualifiedName,ClassType t) throws JClassAlreadyExistsException { int idx = fullyqualifiedName.lastIndexOf('.'); if( idx<0 ) return rootPackage()._class(fullyqualifiedName); else return _package(fullyqualifiedName.substring(0,idx)) ._class(mods, fullyqualifiedName.substring(idx+1), t ); }
public JPackage _package() { int i = fullName.lastIndexOf('.'); if(i>=0) return owner()._package(fullName.substring(0,i)); else return owner().rootPackage(); }
public JPackage _package() { int i = fullName.lastIndexOf('.'); if(i>=0) return owner()._package(fullName.substring(0,i)); else return owner().rootPackage(); }
/** * Gets a reference to the already created generated class. * * @return null * If the class is not yet created. * @see JPackage#_getClass(String) */ public JDefinedClass _getClass(String fullyQualifiedName) { int idx = fullyQualifiedName.lastIndexOf('.'); if( idx<0 ) return rootPackage()._getClass(fullyQualifiedName); else return _package(fullyQualifiedName.substring(0,idx)) ._getClass( fullyQualifiedName.substring(idx+1) ); }
public JPackage _package() { int i = fullName.lastIndexOf('.'); if(i>=0) return owner()._package(fullName.substring(0,i)); else return owner().rootPackage(); }
private JDefinedClass createDummyClass(final JCodeModel codeModel) { try { return codeModel.rootPackage()._class("Dummy"); } catch (final JClassAlreadyExistsException e) { throw new RammlerException( "Failed to create a generated class in a newly initialized JCodeModel. This should never happen!", e); } } }
@Override public JPackage apply(ApiResourceMetadata controllerMetadata, JCodeModel generatableType) { if (StringUtils.hasText(Config.getBasePackage())) { return generatableType._package(Config.getBasePackage()); } return generatableType.rootPackage(); } }
public CClassInfo(Model model,JCodeModel cm, String fullName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations) { super(model,source,location,customizations); this.model = model; int idx = fullName.indexOf('.'); if(idx<0) { this.parent = model.getPackage(cm.rootPackage()); this.shortName = model.allocator.assignClassName(parent,fullName); } else { this.parent = model.getPackage(cm._package(fullName.substring(0,idx))); this.shortName = model.allocator.assignClassName(parent,fullName.substring(idx+1)); } this.typeName = typeName; this.elementName = elementName; model.add(this); }
public CClassInfo(Model model,JCodeModel cm, String fullName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations) { super(model,source,location,customizations); this.model = model; int idx = fullName.indexOf('.'); if(idx<0) { this.parent = model.getPackage(cm.rootPackage()); this.shortName = model.allocator.assignClassName(parent,fullName); } else { this.parent = model.getPackage(cm._package(fullName.substring(0,idx))); this.shortName = model.allocator.assignClassName(parent,fullName.substring(idx+1)); } this.typeName = typeName; this.elementName = elementName; model.add(this); }