com.sun.tools.internal.xjc.outline.ClassOutline Java Examples
The following examples show how to use
com.sun.tools.internal.xjc.outline.ClassOutline.
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: PluginImpl.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { for( ClassOutline co : model.getClasses() ) { CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); if(c==null) continue; // no customization --- nothing to inject here c.markAsAcknowledged(); // TODO: ideally you should validate this DOM element to make sure // that there's no typo/etc. JAXP 1.3 can do this very easily. String codeFragment = DOMUtils.getElementText(c.element); // inject the specified code fragment into the implementation class. co.implClass.direct(codeFragment); } return true; }
Example #2
Source File: SignatureWriter.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private void dump() throws IOException { // collect packages used in the class. Set<JPackage> packages = new TreeSet<JPackage>(new Comparator<JPackage>() { public int compare(JPackage lhs, JPackage rhs) { return lhs.name().compareTo(rhs.name()); } }); for( ClassOutline ci : classes ) packages.add(ci._package()._package()); for( JPackage pkg : packages ) dump( pkg ); out.flush(); }
Example #3
Source File: SourceLocationAddOn.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; }
Example #4
Source File: SignatureWriter.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void dump() throws IOException { // collect packages used in the class. Set<JPackage> packages = new TreeSet<JPackage>(new Comparator<JPackage>() { public int compare(JPackage lhs, JPackage rhs) { return lhs.name().compareTo(rhs.name()); } }); for( ClassOutline ci : classes ) packages.add(ci._package()._package()); for( JPackage pkg : packages ) dump( pkg ); out.flush(); }
Example #5
Source File: SourceLocationAddOn.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; }
Example #6
Source File: SourceLocationAddOn.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; }
Example #7
Source File: SourceLocationAddOn.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; }
Example #8
Source File: PluginImpl.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { for( ClassOutline co : model.getClasses() ) { CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); if(c==null) continue; // no customization --- nothing to inject here c.markAsAcknowledged(); // TODO: ideally you should validate this DOM element to make sure // that there's no typo/etc. JAXP 1.3 can do this very easily. String codeFragment = DOMUtils.getElementText(c.element); // inject the specified code fragment into the implementation class. co.implClass.direct(codeFragment); } return true; }
Example #9
Source File: SignatureWriter.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private void dump() throws IOException { // collect packages used in the class. Set<JPackage> packages = new TreeSet<JPackage>(new Comparator<JPackage>() { public int compare(JPackage lhs, JPackage rhs) { return lhs.name().compareTo(rhs.name()); } }); for( ClassOutline ci : classes ) packages.add(ci._package()._package()); for( JPackage pkg : packages ) dump( pkg ); out.flush(); }
Example #10
Source File: PluginImpl.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { for( ClassOutline co : model.getClasses() ) { CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); if(c==null) continue; // no customization --- nothing to inject here c.markAsAcknowledged(); // TODO: ideally you should validate this DOM element to make sure // that there's no typo/etc. JAXP 1.3 can do this very easily. String codeFragment = DOMUtils.getElementText(c.element); // inject the specified code fragment into the implementation class. co.implClass.direct(codeFragment); } return true; }
Example #11
Source File: PluginImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { for( ClassOutline co : model.getClasses() ) { CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); if(c==null) continue; // no customization --- nothing to inject here c.markAsAcknowledged(); // TODO: ideally you should validate this DOM element to make sure // that there's no typo/etc. JAXP 1.3 can do this very easily. String codeFragment = DOMUtils.getElementText(c.element); // inject the specified code fragment into the implementation class. co.implClass.direct(codeFragment); } return true; }
Example #12
Source File: PluginImpl.java From hottub with GNU General Public License v2.0 | 6 votes |
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { for( ClassOutline co : model.getClasses() ) { CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); if(c==null) continue; // no customization --- nothing to inject here c.markAsAcknowledged(); // TODO: ideally you should validate this DOM element to make sure // that there's no typo/etc. JAXP 1.3 can do this very easily. String codeFragment = DOMUtils.getElementText(c.element); // inject the specified code fragment into the implementation class. co.implClass.direct(codeFragment); } return true; }
Example #13
Source File: SignatureWriter.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void dump() throws IOException { // collect packages used in the class. Set<JPackage> packages = new TreeSet<JPackage>(new Comparator<JPackage>() { public int compare(JPackage lhs, JPackage rhs) { return lhs.name().compareTo(rhs.name()); } }); for( ClassOutline ci : classes ) packages.add(ci._package()._package()); for( JPackage pkg : packages ) dump( pkg ); out.flush(); }
Example #14
Source File: SourceLocationAddOn.java From hottub with GNU General Public License v2.0 | 6 votes |
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; }
Example #15
Source File: SourceLocationAddOn.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; }
Example #16
Source File: PluginImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { for( ClassOutline co : model.getClasses() ) { CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); if(c==null) continue; // no customization --- nothing to inject here c.markAsAcknowledged(); // TODO: ideally you should validate this DOM element to make sure // that there's no typo/etc. JAXP 1.3 can do this very easily. String codeFragment = DOMUtils.getElementText(c.element); // inject the specified code fragment into the implementation class. co.implClass.direct(codeFragment); } return true; }
Example #17
Source File: SignatureWriter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private void dump() throws IOException { // collect packages used in the class. Set<JPackage> packages = new TreeSet<JPackage>(new Comparator<JPackage>() { public int compare(JPackage lhs, JPackage rhs) { return lhs.name().compareTo(rhs.name()); } }); for( ClassOutline ci : classes ) packages.add(ci._package()._package()); for( JPackage pkg : packages ) dump( pkg ); out.flush(); }
Example #18
Source File: SignatureWriter.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private void dump() throws IOException { // collect packages used in the class. Set<JPackage> packages = new TreeSet<JPackage>(new Comparator<JPackage>() { public int compare(JPackage lhs, JPackage rhs) { return lhs.name().compareTo(rhs.name()); } }); for( ClassOutline ci : classes ) packages.add(ci._package()._package()); for( JPackage pkg : packages ) dump( pkg ); out.flush(); }
Example #19
Source File: SourceLocationAddOn.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; }
Example #20
Source File: SignatureWriter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private void dumpChildren( JClassContainer cont ) throws IOException { Iterator itr = cont.classes(); while(itr.hasNext()) { JDefinedClass cls = (JDefinedClass)itr.next(); ClassOutline ci = classSet.get(cls); if(ci!=null) dump(ci); } }
Example #21
Source File: SignatureWriter.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void dumpChildren( JClassContainer cont ) throws IOException { Iterator itr = cont.classes(); while(itr.hasNext()) { JDefinedClass cls = (JDefinedClass)itr.next(); ClassOutline ci = classSet.get(cls); if(ci!=null) dump(ci); } }
Example #22
Source File: PluginImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) { // we want this to work without requiring JSR-250 jar. annotation = model.getCodeModel().ref("javax.annotation.Generated"); for( ClassOutline co : model.getClasses() ) augument(co); for( EnumOutline eo : model.getEnums() ) augument(eo); //TODO: process generated ObjectFactory classes? return true; }
Example #23
Source File: SignatureWriter.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private SignatureWriter( Outline model, Writer out ) { this.out = out; this.classes = model.getClasses(); for( ClassOutline ci : classes ) classSet.put( ci.ref, ci ); }
Example #24
Source File: SignatureWriter.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private SignatureWriter( Outline model, Writer out ) { this.out = out; this.classes = model.getClasses(); for( ClassOutline ci : classes ) classSet.put( ci.ref, ci ); }
Example #25
Source File: PluginImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) { // we want this to work without requiring JSR-250 jar. annotation = model.getCodeModel().ref("javax.annotation.Generated"); for( ClassOutline co : model.getClasses() ) augument(co); for( EnumOutline eo : model.getEnums() ) augument(eo); //TODO: process generated ObjectFactory classes? return true; }
Example #26
Source File: PluginImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Adds "@Generated" to the classes, methods, and fields. */ private void augument(ClassOutline co) { annotate(co.implClass); for (JMethod m : co.implClass.methods()) annotate(m); for (JFieldVar f : co.implClass.fields().values()) annotate(f); }
Example #27
Source File: SignatureWriter.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private void dump( ClassOutline ci ) throws IOException { JDefinedClass cls = ci.implClass; StringBuilder buf = new StringBuilder(); buf.append("interface "); buf.append(cls.name()); boolean first=true; Iterator itr = cls._implements(); while(itr.hasNext()) { if(first) { buf.append(" extends "); first=false; } else { buf.append(", "); } buf.append( printName((JClass)itr.next()) ); } buf.append(" {"); println(buf.toString()); indent++; // dump the field for( FieldOutline fo : ci.getDeclaredFields() ) { String type = printName(fo.getRawType()); println(type+' '+fo.getPropertyInfo().getName(true)+';'); } dumpChildren(cls); indent--; println("}"); }
Example #28
Source File: SignatureWriter.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private SignatureWriter( Outline model, Writer out ) { this.out = out; this.classes = model.getClasses(); for( ClassOutline ci : classes ) classSet.put( ci.ref, ci ); }
Example #29
Source File: SignatureWriter.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void dumpChildren( JClassContainer cont ) throws IOException { Iterator itr = cont.classes(); while(itr.hasNext()) { JDefinedClass cls = (JDefinedClass)itr.next(); ClassOutline ci = classSet.get(cls); if(ci!=null) dump(ci); } }
Example #30
Source File: PluginImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) { // we want this to work without requiring JSR-250 jar. annotation = model.getCodeModel().ref("javax.annotation.Generated"); for( ClassOutline co : model.getClasses() ) augument(co); for( EnumOutline eo : model.getEnums() ) augument(eo); //TODO: process generated ObjectFactory classes? return true; }