Checker.notNull("parameter:type", type);
final GeneratorContext context = this.getGeneratorContext();
context.debug("Creating new type \"" + type.getName() + "\".");
final NewConcreteType newType = context.newConcreteType(newTypeName);
newType.setAbstract(false);
newType.setFinal(false);
// extend either JsonSerializerType or the generated type of type...
Type superType = type.getSuperType();
String superTypeName = Constants.JSON_SERIALIZER_TYPE;
if (false == superType.equals(context.getObject())) {
superTypeName = this.getGeneratedTypeName(superType.getName());
}
superType = context.getType(superTypeName);
newType.setSuperType(superType);
newType.setVisibility(Visibility.PUBLIC);
return newType;
}