public OutputStream openBinary(JPackage pkg, String fileName) throws IOException { StandardLocation loc; if(fileName.endsWith(".java")) { // Annotation Processing doesn't do the proper Unicode escaping on Java source files, // so we can't rely on Filer.createSourceFile. loc = SOURCE_PATH; } else { // put non-Java files directly to the output folder loc = CLASS_PATH; } return filer.createResource(loc, pkg.name(), fileName).openOutputStream(); }
public Writer openSource(JPackage pkg, String fileName) throws IOException { String name; if(pkg.isUnnamed()) name = fileName; else name = pkg.name()+'.'+fileName; name = name.substring(0,name.length()-5); // strip ".java" return filer.createSourceFile(name).openWriter(); }
resourceListClass.annotate(ApiGroup.class).param("value", apiGroup); if (resourceClass.getPackage().name().startsWith("io.fabric8.kubernetes")) { JAnnotationArrayMember arrayMember = resourceClass.annotate(VelocityTransformations.class) .paramArray("value"); arrayMember.annotate(VelocityTransformation.class).param("value", "/manifest.vm") .param("outputPath", "kubernetes.properties").param("gather", true); } else if (resourceClass.getPackage().name().startsWith("io.fabric8.openshift")) { JAnnotationArrayMember arrayMember = resourceClass.annotate(VelocityTransformations.class) .paramArray("value");
@Override public boolean matches( final JPackage pkg, final Set<String> packages ) { return packages.contains( pkg.name() ); } },
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException { String pkgName = pkg.name(); if(pkgName.length()!=0) pkgName += '.'; out.println( "-----------------------------------" + pkgName+fileName + "-----------------------------------"); return new FilterOutputStream(out) { public void close() { // don't let this stream close } }; }
public Writer openSource(JPackage pkg, String fileName) throws IOException { String tmp = fileName.substring(0, fileName.length()-5); if (pkg.name() != null && ! "".equals(pkg.name())) { w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter(); } else { w = filer.createSourceFile(tmp).openWriter(); } return w; }
@Override public OutputStream openBinary(JPackage pkg, String fileName) throws IOException { this.filer = OperationProcessor.super.processingEnv.getFiler(); if(fileName.endsWith(".java")){ fileName = fileName.substring(0, fileName.length() - ".java".length()); } JavaFileObject sourceFile = this.filer.createSourceFile(pkg.name() + "." + fileName); return sourceFile.openOutputStream(); }
private void report(JPackage pkg, String fileName) { if(pkg.isUnnamed()) progress.println(fileName); else progress.println( pkg.name().replace('.',File.separatorChar) +File.separatorChar+fileName); }
public static String getContextPath(GeneratorContext context) { final StringBuffer sb = new StringBuffer(); final PackageContext[] packageContexts = context.getAllPackageContexts(); for (int index = 0; index < packageContexts.length; index++) { final PackageContext packageContext = packageContexts[index]; final String packageName = (String) packageContext._package.name(); sb.append(packageName); if (index < packageContexts.length - 1) sb.append(':'); } return sb.toString(); }
private void report(JPackage pkg, String fileName) { if(pkg.isUnnamed()) progress.println(fileName); else progress.println( pkg.name().replace('.',File.separatorChar) +File.separatorChar+fileName); }
@Override public OutputStream openBinary(JPackage pkg, String fileName) throws IOException { outputStream = processingEnv.getFiler().createSourceFile(pkg.name() + "." + StringUtils.removeEnd(fileName, ".java")).openOutputStream(); return outputStream; }
public String process(String line) { if(!line.startsWith("package ")) return line; // replace package decl if( pkg.isUnnamed() ) return null; else return "package "+pkg.name()+";"; } };
public String fullName() { if(pkg.isUnnamed()) return className; else return pkg.name()+'.'+className; }
/** * Returns the package name of this <code>JavaClass</code>. * * @return the <code>String</code> name of this <code>JavaClass'</code> <code>JavaPackage</code>. */ public String getPackageName() { return xjcClass._package().name(); }
public static String getContextPath(Outline context) { final StringBuilder sb = new StringBuilder(); for (final Iterator<? extends PackageOutline> packageOutlines = context .getAllPackageContexts().iterator(); packageOutlines.hasNext();) { final PackageOutline packageOutline = packageOutlines.next(); final String packageName = packageOutline._package().name(); sb.append(packageName); if (packageOutlines.hasNext()) sb.append(':'); } return sb.toString(); }
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException { if (verbose) { if (pkg.isUnnamed()) log.info("XJC writing: " + fileName); else log.info("XJC writing: " + pkg.name().replace('.', File.separatorChar) + File.separatorChar + fileName); } return core.openBinary(pkg, fileName); }
public Writer openSource(JPackage pkg, String fileName) throws IOException { if (verbose) { if (pkg.isUnnamed()) log.info("XJC writing: " + fileName); else log.info("XJC writing: " + pkg.name().replace('.', File.separatorChar) + File.separatorChar + fileName); } return core.openSource(pkg, fileName); }
public Writer openSource(JPackage pkg, String fileName) throws IOException { if (verbose) { if (pkg.isUnnamed()) log.info("XJC writing: " + fileName); else log.info("XJC writing: " + pkg.name().replace('.', File.separatorChar) + File.separatorChar + fileName); } return core.openSource(pkg, fileName); }
private String getFilePath(ClassContext classContext, FieldItem fieldItem) { final String path = classContext._package._package.name() + File.separator + ClassUtils.getLCN(classContext.target, false) + "." + fieldItem.name + getExtension(); return path; }
private void dump( JPackage pkg ) throws IOException { println("package "+pkg.name()+" {"); indent++; dumpChildren(pkg); indent--; println("}"); }