Package com.sun.jersey.server.wadl

Examples of com.sun.jersey.server.wadl.WadlGenerator


        final List<WadlGeneratorDescription> list = wadlGeneratorDescriptions != null ? Arrays.asList(wadlGeneratorDescriptions) : null;
        return loadWadlGeneratorDescriptions(list);
    }

    static WadlGenerator loadWadlGeneratorDescriptions(List<WadlGeneratorDescription> wadlGeneratorDescriptions) throws Exception {
        WadlGenerator wadlGenerator = new WadlGeneratorImpl();

        final CallbackList callbacks = new CallbackList();
        try {
            if (wadlGeneratorDescriptions != null && !wadlGeneratorDescriptions.isEmpty()) {
                for (WadlGeneratorDescription wadlGeneratorDescription : wadlGeneratorDescriptions) {
                    final WadlGeneratorControl control = loadWadlGenerator(wadlGeneratorDescription, wadlGenerator);
                    wadlGenerator = control.wadlGenerator;
                    callbacks.add(control.callback);
                }
            }
            wadlGenerator.init();
        } finally {
            callbacks.callback();
        }

        return wadlGenerator;
View Full Code Here


    private static WadlGeneratorControl loadWadlGenerator(
            WadlGeneratorDescription wadlGeneratorDescription,
            com.sun.jersey.server.wadl.WadlGenerator wadlGeneratorDelegate) throws Exception {
        LOGGER.info("Loading wadlGenerator " + wadlGeneratorDescription.getGeneratorClass().getName());
        final WadlGenerator generator = wadlGeneratorDescription.getGeneratorClass().newInstance();
        generator.setWadlGeneratorDelegate(wadlGeneratorDelegate);
        CallbackList callbacks = null;
        if (wadlGeneratorDescription.getProperties() != null
                && !wadlGeneratorDescription.getProperties().isEmpty()) {
            callbacks = new CallbackList();
            for (Entry<Object, Object> entry : wadlGeneratorDescription.getProperties().entrySet()) {
View Full Code Here

            return this;
        }

        public WadlGeneratorConfig build() {
            try {
                final WadlGenerator wadlGenerator = WadlGeneratorLoader.loadWadlGenerators( _generators );
                return new WadlGeneratorConfigGeneratorImpl( wadlGenerator ) {
                   
                };
            } catch ( Exception e ) {
                throw new RuntimeException( "Could not load wadl generators.", e );
View Full Code Here

    public static WadlGenerator loadWadlGeneratorsFromConfig( ResourceConfig resourceConfig ) {
        final Object wadlGeneratorConfigProperty = resourceConfig.getProperty(
                ResourceConfig.PROPERTY_WADL_GENERATOR_CONFIG );
        if ( wadlGeneratorConfigProperty == null ) {
            final WadlGenerator wadlGenerator = new WadlGeneratorImpl();
            try {
                wadlGenerator.init();
                return wadlGenerator;
            } catch ( Exception e ) {
                throw new RuntimeException( "Could not init the " + wadlGenerator.getClass().getName(), e );
            }
        }
        else {

            try {
View Full Code Here

    private static final Logger LOGGER = Logger.getLogger( WadlGeneratorLoader.class.getName() );

    static WadlGenerator loadWadlGenerators(
            List<WadlGenerator> wadlGenerators ) throws Exception {
        WadlGenerator wadlGenerator = new WadlGeneratorImpl();
        if ( wadlGenerators != null && !wadlGenerators.isEmpty() ) {
            for ( WadlGenerator generator : wadlGenerators ) {
                generator.setWadlGeneratorDelegate( wadlGenerator );
                wadlGenerator = generator;
            }
        }
        wadlGenerator.init();
        return wadlGenerator;
    }
View Full Code Here

        final List<WadlGeneratorDescription> list = wadlGeneratorDescriptions != null ? Arrays.asList( wadlGeneratorDescriptions ) : null;
        return loadWadlGeneratorDescriptions( list );
    }

    static WadlGenerator loadWadlGeneratorDescriptions( List<WadlGeneratorDescription> wadlGeneratorDescriptions ) throws Exception {
        WadlGenerator wadlGenerator = new WadlGeneratorImpl();
        if ( wadlGeneratorDescriptions != null && !wadlGeneratorDescriptions.isEmpty() ) {
            for ( WadlGeneratorDescription wadlGeneratorDescription : wadlGeneratorDescriptions ) {
                wadlGenerator = loadWadlGenerator( wadlGeneratorDescription, wadlGenerator );
            }
        }
        wadlGenerator.init();
        return wadlGenerator;
       
    }
View Full Code Here

    private static WadlGenerator loadWadlGenerator(
            WadlGeneratorDescription wadlGeneratorDescription,
            com.sun.jersey.server.wadl.WadlGenerator wadlGeneratorDelegate ) throws Exception {
        LOGGER.info( "Loading wadlGenerator " + wadlGeneratorDescription.getGeneratorClass().getName() );
        final WadlGenerator generator = wadlGeneratorDescription.getGeneratorClass().newInstance();
        generator.setWadlGeneratorDelegate( wadlGeneratorDelegate );
        if ( wadlGeneratorDescription.getProperties() != null
                && !wadlGeneratorDescription.getProperties().isEmpty() ) {
            for ( Entry<Object, Object> entry : wadlGeneratorDescription.getProperties().entrySet() ) {
                setProperty( generator, entry.getKey().toString(), entry.getValue() );
            }
View Full Code Here

    private WadlGenerator loadWadlGenerator(
            WadlGeneratorDescription wadlGeneratorDescription,
            com.sun.jersey.server.wadl.WadlGenerator wadlGeneratorDelegate ) throws Exception {
        getLog().info( "Loading wadlGenerator " + wadlGeneratorDescription.getClassName() );
        final Class<?> clazz = Class.forName( wadlGeneratorDescription.getClassName(), true, Thread.currentThread().getContextClassLoader() );
        final WadlGenerator generator = clazz.asSubclass( WadlGenerator.class ).newInstance();
        generator.setWadlGeneratorDelegate( wadlGeneratorDelegate );
        if ( wadlGeneratorDescription.getProperties() != null
                && !wadlGeneratorDescription.getProperties().isEmpty() ) {
            for ( Entry<Object, Object> entry : wadlGeneratorDescription.getProperties().entrySet() ) {
                setProperty( generator, entry.getKey().toString(), entry.getValue() );
            }
View Full Code Here

            return this;
        }

        public WadlGeneratorConfig build() {
            try {
                final WadlGenerator wadlGenerator = WadlGeneratorLoader.loadWadlGenerators( _generators );
                return new WadlGeneratorConfigGeneratorImpl( wadlGenerator ) {
                   
                };
            } catch ( Exception e ) {
                throw new RuntimeException( "Could not load wadl generators.", e );
View Full Code Here

TOP

Related Classes of com.sun.jersey.server.wadl.WadlGenerator

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.