}
if ( type.isNovel() ) {
String fullName = typeDescr.getType().getFullName();
JavaDialectRuntimeData dialect = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );
switch ( type.getFormat() ) {
case TRAIT :
try {
byte[] d;
ClassBuilder tb = ClassBuilderFactory.getTraitBuilderService();
d = tb.buildClass( def );
dialect.write( JavaDialectRuntimeData.convertClassToResourcePath( fullName ),
d );
} catch ( Exception e ) {
this.results.add( new TypeDeclarationError( "Unable to compile declared trait " + fullName + ": " + e.getMessage() + ";",
typeDescr.getLine() ) );
}
break;
case POJO :
default :
try {
ClassBuilder cb = ClassBuilderFactory.getBeanClassBuilderService();
byte[] d = cb.buildClass( def );
dialect.write( JavaDialectRuntimeData.convertClassToResourcePath( fullName ),
d );
} catch ( Exception e ) {
this.results.add( new TypeDeclarationError( "Unable to create a class for declared type " + fullName + ": " + e.getMessage() + ";",
typeDescr.getLine() ) );