private CtClass createCtClass(final SgClass modelClass) throws NotFoundException,
            CannotCompileException {

        // Create class
        final CtClass clasz = pool.makeClass(modelClass.getName());
        clasz.setModifiers(SgUtils.toModifiers(modelClass.getModifiers()));

        // Add superclass
        if (modelClass.getSuperClass() != null) {
            clasz.setSuperclass(pool.get(modelClass.getSuperClass().getName()));
        }

        addInterfaces(modelClass, clasz);
        addFields(modelClass, clasz);
        addConstructors(modelClass, clasz);
        addMethods(modelClass, clasz);

        return clasz;
    }
private CtClass createCtClass ( final SgClass modelClass ) throws NotFoundException , CannotCompileException { final CtClass clasz = pool . makeClass ( modelClass . getName ( ) ) ; clasz . setModifiers ( SgUtils . toModifiers ( modelClass . getModifiers ( ) ) ) ; if ( modelClass . getSuperClass ( ) != null ) { clasz . setSuperclass ( pool . get ( modelClass . getSuperClass ( ) . getName ( ) ) ) ; } addInterfaces ( modelClass , clasz ) ; addFields ( modelClass , clasz ) ; addConstructors ( modelClass , clasz ) ; addMethods ( modelClass , clasz ) ; return clasz ; }
Creates a Javassist class from a given model class.

@param modelClass
Model class to convert into a Javassist class.

@return Javassist class.

@throws NotFoundException
A class or interface from the model was not found.
@throws CannotCompileException
Some source from the model cannot be compiled.