Package com.sun.jersey.server.wadl

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


    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


     * Create a new instance of {@link WadlGenerator}, based on the {@link WadlGeneratorDescription}s
     * provided by {@link #configure()}.
     * @return the initialized {@link WadlGenerator}
     */
    public WadlGenerator createWadlGenerator() {
        WadlGenerator wadlGenerator = null;
        final List<WadlGeneratorDescription> wadlGeneratorDescriptions = configure();
        try {
            wadlGenerator = WadlGeneratorLoader.loadWadlGeneratorDescriptions( wadlGeneratorDescriptions );
        } catch ( Exception e ) {
            throw new RuntimeException( "Could not load wadl generators from wadlGeneratorDescriptions.", e );
View Full Code Here

        // Get the root application description
        //

        ApplicationDescription description = getApplication(info);

        WadlGenerator wadlGenerator = wadlGeneratorConfig.createWadlGenerator();
        Application a = path == null ? new WadlBuilder( wadlGenerator ).generate(description,resource) :
                new WadlBuilder( wadlGenerator ).generate(description, resource, path);

        for(Resources resources : a.getResources())
            resources.setBase(info.getBaseUri().toString());
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

            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

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.