Package ar.com.dgarcia.javaspec.api

Examples of ar.com.dgarcia.javaspec.api.JavaSpec


        return parser;
    }

    public SpecTree parse(Class<? extends JavaSpec> specClass) {
        SpecTree createdTree = SpecTreeDefinition.create();
        JavaSpec createdSpec = instantiate(specClass);
        createdSpec.populate(createdTree);
        return createdTree;
    }
View Full Code Here


    /**
     * Creates the new instance using reflection on niladic constructor
     */
    private JavaSpec instantiate(Class<? extends JavaSpec> specClass) {
        try {
            JavaSpec createdInstance = specClass.newInstance();
            return createdInstance;
        } catch( SecurityException e){
            throw new SpecException("Security forbids instantiation for spec["+specClass+"]",e);
        } catch( ExceptionInInitializerError e){
            throw new SpecException("Constructor failed for new spec["+specClass+"] instance", e);
View Full Code Here

TOP

Related Classes of ar.com.dgarcia.javaspec.api.JavaSpec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.