if (!Thing.class.isAssignableFrom( resolvedType )) {
updateTraitDefinition( type,
resolvedType );
String target = typeDescr.getTypeName() + TraitFactory.SUFFIX;
TypeDeclarationDescr tempDescr = new TypeDeclarationDescr();
tempDescr.setNamespace( typeDescr.getNamespace() );
tempDescr.setFields( typeDescr.getFields() );
tempDescr.setType( target,
typeDescr.getNamespace() );
tempDescr.addSuperType( typeDescr.getType() );
TypeDeclaration tempDeclr = new TypeDeclaration( target );
tempDeclr.setFormat( TypeDeclaration.Format.TRAIT );
tempDeclr.setTypesafe( type.isTypesafe() );
tempDeclr.setNovel( true );
tempDeclr.setTypeClassName( tempDescr.getType().getFullName() );
tempDeclr.setResource( type.getResource() );
ClassDefinition tempDef = new ClassDefinition( target );
tempDef.setClassName( tempDescr.getType().getFullName() );
tempDef.setTraitable( false );
for (FieldDefinition fld : def.getFieldsDefinitions()) {
tempDef.addField( fld );
}
tempDef.setInterfaces( def.getInterfaces() );