Package com.sun.research.ws.wadl

Examples of com.sun.research.ws.wadl.Application


        return new Resources();
    }

    @Override
    public Application createApplication() {
        return new Application();
    }
View Full Code Here


                }
            }
            wadlGenerator.init();

            final ApplicationDescription ad = this.createApplicationDescription(this._packagesResourceConfig, wadlGenerator);
            final Application a = ad.getApplication();
            for(Resources resources : a.getResources())
                resources.setBase(_baseUri);

            this.writeExternalGrammars(ad);

            final JAXBContext c = JAXBContext.newInstance( wadlGenerator.getRequiredJaxbContextPath(),
View Full Code Here

            }
            hrefs.add(key);
        }

        JAXBGrammars grammars = new JAXBGrammars(hrefs);
        Application application = ad.getApplication();
        application.setGrammars(grammars);
    }
View Full Code Here

        return new Resources();
    }

    @Override
    public Application createApplication() {
        return new Application();
    }
View Full Code Here

    /**
     * @return application
     * @see com.sun.jersey.server.wadl.WadlGenerator#createApplication()
     */
    public Application createApplication() {
        final Application result = _delegate.createApplication();
        if ( result.getGrammars() != null ) {
            LOG.info( "The wadl application created by the delegate ("+ _delegate +") already contains a grammars element," +
                " we're adding elements of the provided grammars file." );
            if ( !_grammars.getAny().isEmpty() ) {
                result.getGrammars().getAny().addAll( _grammars.getAny() );
            }
            if ( !_grammars.getDoc().isEmpty() ) {
                result.getGrammars().getDoc().addAll( _grammars.getDoc() );
            }
            if ( !_grammars.getInclude().isEmpty() ) {
                result.getGrammars().getInclude().addAll( _grammars.getInclude() );
            }
        }
        else {
            result.setGrammars( _grammars );
        }
        return result;
    }
View Full Code Here

    @Override
    public ApplicationDescription getApplication(final UriInfo uriInfo, final boolean detailedWadl) {
        final ApplicationDescription applicationDescription = getWadlBuilder(detailedWadl, uriInfo)
                .generate(resourceContext.getResourceModel().getRootResources());
        final Application application = applicationDescription.getApplication();
        for (final Resources resources : application.getResources()) {
            if (resources.getBase() == null) {
                resources.setBase(uriInfo.getBaseUri().toString());
            }
        }
        attachExternalGrammar(application, applicationDescription, uriInfo.getRequestUri());
View Full Code Here

        //

        final ApplicationDescription description = getApplication(info, detailedWadl);

        final WadlGenerator wadlGenerator = wadlGeneratorConfig.createWadlGenerator(serviceLocator);
        final Application application = new WadlBuilder(wadlGenerator, detailedWadl, info).generate(description, resource);
        if (application == null) {
            return null;
        }

        for (final Resources resources : application.getResources()) {
            resources.setBase(info.getBaseUri().toString());
        }

        // Attach any grammar we may have

        attachExternalGrammar(application, description,
                info.getRequestUri());

        for (final Resources resources : application.getResources()) {
            final Resource r = resources.getResource().get(0);
            r.setPath(info.getBaseUri().relativize(info.getAbsolutePath()).toString());

            // remove path params since path is fixed at this point
            r.getParam().clear();
View Full Code Here

    /**
     * @return the application
     * @see com.sun.jersey.server.impl.wadl.WadlGenerator#createApplication()
     */
    public Application createApplication() {
        final Application result = _delegate.createApplication();
        if (_applicationDocs != null && _applicationDocs.getDocs() != null &&
                !_applicationDocs.getDocs().isEmpty()) {
            result.getDoc().addAll(_applicationDocs.getDocs());
        }
        return result;
    }
View Full Code Here

    /**
     * @return
     * @see com.sun.jersey.server.impl.wadl.WadlGenerator#createApplication()
     */
    public Application createApplication() {
        final Application result = _delegate.createApplication();
        if ( result.getGrammars() != null ) {
            LOG.info( "The wadl application created by the delegate ("+ _delegate +") already contains a grammars element," +
                " we're adding elements of the provided grammars file." );
            if ( !_grammars.getAny().isEmpty() ) {
                result.getGrammars().getAny().addAll( _grammars.getAny() );
            }
            if ( !_grammars.getDoc().isEmpty() ) {
                result.getGrammars().getDoc().addAll( _grammars.getDoc() );
            }
            if ( !_grammars.getInclude().isEmpty() ) {
                result.getGrammars().getInclude().addAll( _grammars.getInclude() );
            }
        }
        else {
            result.setGrammars( _grammars );
        }
        return result;
    }
View Full Code Here

        }

        @Override
        public void dispatch(final Object o, final HttpContext context) {
            if(wadlApplicationContext.isWadlGenerationEnabled()) {
                final Application a = wadlApplicationContext.getApplication(
                        context.getUriInfo(),
                        resource, path);

                try {
                    final Marshaller marshaller = wadlApplicationContext.getJAXBContext().createMarshaller();
View Full Code Here

TOP

Related Classes of com.sun.research.ws.wadl.Application

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.