protected JPackage getPackage(JPackage pkg, Aspect a) { switch(a) { case EXPOSED: return pkg; case IMPLEMENTATION: return pkg.subPackage("impl"); default: assert false; throw new IllegalStateException(); } }
protected JPackage getPackage(JPackage pkg, Aspect a) { switch(a) { case EXPOSED: return pkg; case IMPLEMENTATION: return pkg.subPackage("impl"); default: assert false; throw new IllegalStateException(); } }
protected JPackage getPackage(JPackage pkg, Aspect a) { switch(a) { case EXPOSED: return pkg; case IMPLEMENTATION: return pkg.subPackage("impl"); default: assert false; throw new IllegalStateException(); } }
protected JPackage getPackage(JPackage pkg, Aspect a) { switch(a) { case EXPOSED: return pkg; case IMPLEMENTATION: return pkg.subPackage("impl"); default: assert false; throw new IllegalStateException(); } }
protected JPackage getPackage(JPackage pkg, Aspect a) { switch(a) { case EXPOSED: return pkg; case IMPLEMENTATION: return pkg.subPackage("impl"); default: assert false; throw new IllegalStateException(); } }
public final JClass addRuntime(Class clazz) { JClass g = generatedRuntime.get(clazz); if (g == null) { // put code into a separate package to avoid name conflicts. JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime"); g = generateStaticClass(clazz, implPkg); generatedRuntime.put(clazz, g); } return g; }
public final JClass addRuntime(Class clazz) { JClass g = generatedRuntime.get(clazz); if (g == null) { // put code into a separate package to avoid name conflicts. JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime"); g = generateStaticClass(clazz, implPkg); generatedRuntime.put(clazz, g); } return g; }
public final JClass addRuntime(Class clazz) { JClass g = generatedRuntime.get(clazz); if (g == null) { // put code into a separate package to avoid name conflicts. JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime"); g = generateStaticClass(clazz, implPkg); generatedRuntime.put(clazz, g); } return g; }
public final JClass addRuntime(Class clazz) { JClass g = generatedRuntime.get(clazz); if(g==null) { // put code into a separate package to avoid name conflicts. JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime"); g = generateStaticClass(clazz,implPkg); generatedRuntime.put(clazz,g); } return g; }
public final JClass addRuntime(Class clazz) { JClass g = generatedRuntime.get(clazz); if(g==null) { // put code into a separate package to avoid name conflicts. JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime"); g = generateStaticClass(clazz,implPkg); generatedRuntime.put(clazz,g); } return g; }
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
final JPackage thePackage = parentPackage.subPackage(packageName.toString()); context.registerNode(subPackagePath, thePackage);
if (children!=null) { for (File child : children) walk(child,pkg.subPackage(h2j(child.getName())),dirName+'/'+child.getName());
private void generateAvroSchemas(JPackage rootPackage, Set<NamedAvroType> avroTypes) { JPackage avroPackage = rootPackage.subPackage("avroSchemas"); System.out.println("Writing schemas under package '"+ avroPackage.name() +"'"); // check for name collisions checkForCollisions(avroTypes); // sort results by dependency List<NamedAvroType> orderedTypes = topologicalSort(avroTypes); // add in special types for (String ns : helper.getSpecialSchemas().get(DateAvroType.class)) { orderedTypes.add(0, DateAvroType.getSchema(ns)); } for (String ns : helper.getSpecialSchemas().get(ReferenceAvroType.class)) { orderedTypes.add(0, ReferenceAvroType.getSchema(ns)); } // output in an ordered way outputSchema(avroPackage, orderedTypes); // output debug summary JTextFile avroSchema = new JTextFile("avroSchemas.txt"); StringBuilder sb = new StringBuilder(); for (NamedAvroType type : orderedTypes) { sb.append(getJson(type)); } avroSchema.setContents(sb.toString()); rootPackage.addResourceFile(avroSchema); }
JPackage subPackage = packageParent.pkg.subPackage(name);