本文整理汇总了Java中com.sun.tools.internal.xjc.reader.xmlschema.Messages类的典型用法代码示例。如果您正苦于以下问题:Java Messages类的具体用法?Java Messages怎么用?Java Messages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Messages类属于com.sun.tools.internal.xjc.reader.xmlschema包,在下文中一共展示了Messages类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateCode
import com.sun.tools.internal.xjc.reader.xmlschema.Messages; //导入依赖的package包/类
/**
* Fully-generate the source code into the given model.
*
* @return
* null if there was any errors. Otherwise it returns a valid
* {@link Outline} object, which captures how the model objects
* are mapped to the generated source code.
* <p>
* Add-ons can use those information to further augment the generated
* source code.
*/
public Outline generateCode(Options opt,ErrorReceiver receiver) {
ErrorReceiverFilter ehf = new ErrorReceiverFilter(receiver);
// run extensions // moved to BGMBuilder._build() - issue with hyperjaxb3
// for( Plugin ma : opt.activePlugins )
// ma.postProcessModel(this,ehf);
Outline o = BeanGenerator.generate(this, ehf);
try {// run extensions
for( Plugin ma : opt.activePlugins )
ma.run(o,opt,ehf);
} catch (SAXException e) {
// fatal error. error should have been reported
return null;
}
// check for unused plug-in customizations.
// these can be only checked after the plug-ins run, so it's here.
// the JAXB bindings are checked by XMLSchema's builder.
Set<CCustomizations> check = new HashSet<CCustomizations>();
for( CCustomizations c=customizations; c!=null; c=c.next ) {
if(!check.add(c)) {
throw new AssertionError(); // detect a loop
}
for (CPluginCustomization p : c) {
if(!p.isAcknowledged()) {
ehf.error(
p.locator,
Messages.format(
Messages.ERR_UNACKNOWLEDGED_CUSTOMIZATION,
p.element.getNodeName()
));
ehf.error(
c.getOwner().getLocator(),
Messages.format(
Messages.ERR_UNACKNOWLEDGED_CUSTOMIZATION_LOCATION));
}
}
}
if(ehf.hadError())
o = null;
return o;
}