/** * Write the package-info.java source to the specified file. * * @param bytecode The bytecode for the package-info.class * @param packageSourceFile The source file. * @return Whether the file was actually written. */ protected boolean writePackageSourceFile(InputStream bytecode, File packageSourceFile) throws IOException { JaxbPackageInfoWriter writer = new JaxbPackageInfoWriter(); String info = writer.write(bytecode); if (info != null) { packageSourceFile.getParentFile().mkdirs(); FileWriter out = new FileWriter(packageSourceFile); out.write(info); out.flush(); out.close(); return true; } return false; }
writeAnnotationNode((org.codehaus.enunciate.asm.tree.AnnotationNode) value, writer); writer.write(','); writeAnnotationValue(valueItem, writer); first = false;
/** * Write an annotation node. * * @param annotation The annotation. * @param writer The writer. */ protected void writeAnnotationNode(AnnotationNode annotation, Writer writer) throws IOException { writer.write('@'); writer.write(Type.getType(annotation.desc).getClassName()); writer.write('('); if (annotation.values != null) { boolean first = true; Iterator valuesIt = annotation.values.iterator(); while (valuesIt.hasNext()) { if (!first) { writer.write(','); } writer.write((String) valuesIt.next()); Object value = valuesIt.next(); writer.write('='); writeAnnotationValue(value, writer); first = false; } } writer.write(')'); }
org.codehaus.enunciate.asm.tree.AnnotationNode annotation = (org.codehaus.enunciate.asm.tree.AnnotationNode) visibleAnnotation; if (Type.getType(annotation.desc).getClassName().startsWith("javax.xml.bind")) { writeAnnotationNode(annotation, writer); writer.write('\n'); jaxbFound = true;