Package com.sun.research.ws.wadl

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


            this.lastBaseUri = uriInfo.getBaseUri();
            this.lastModified = new SimpleDateFormat(HTTPDATEFORMAT).format(new Date());
            this.lastVariant = v;

            applicationDescription = wadlContext.getApplication(uriInfo);
            final Application application = applicationDescription.getApplication();

            final ByteArrayOutputStream os = new ByteArrayOutputStream();

            if(v.getMediaType().equals(MediaTypes.WADL)) {
                try {
View Full Code Here


    /**
     * @return application
     * @see com.sun.jersey.server.wadl.WadlGenerator#createApplication()
     */
    public Application createApplication(UriInfo requestInfo) {
        final Application result = _delegate.createApplication(requestInfo);
        if ( result.getGrammars() != null && !overrideGrammars) {
            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(UriInfo uriInfo, boolean detailedWadl) {
        ApplicationDescription applicationDescription = getWadlBuilder(detailedWadl, uriInfo)
                .generate(resourceContext.getResourceModel().getRootResources());
        final Application application = applicationDescription.getApplication();
        for (Resources resources : application.getResources()) {
            if (resources.getBase() == null) {
                resources.setBase(uriInfo.getBaseUri().toString());
            }
        }
        attachExternalGrammar(application, applicationDescription, uriInfo.getRequestUri());
View Full Code Here

        //

        ApplicationDescription description = getApplication(info, detailedWadl);

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

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

        // Attach any grammar we may have

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

        for (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

            final RuntimeResource resource = extendedUriInfo.getMatchedRuntimeResources().get(0);
            // TODO: support multiple resources, see ignored tests in WadlResourceTest.Wadl8Test
            final UriInfo uriInfo = containerRequestContext.getUriInfo();

            final Application wadlApplication = wadlApplicationContext.getApplication(uriInfo,
                    resource.getResources().get(0), WadlUtils.isDetailedWadlRequested(uriInfo));

            if (wadlApplication == null) {
                // wadlApplication can be null if limited WADL is requested and all content
                // of wadlApplication is invisible in limited WADL
View Full Code Here

     * Generate WADL for a set of resources.
     * @param resources the set of resources
     * @return the JAXB WADL application bean
     */
    public ApplicationDescription generate(List<org.glassfish.jersey.server.model.Resource> resources) {
        Application wadlApplication = _wadlGenerator.createApplication();
        Resources wadlResources = _wadlGenerator.createResources();

        // for each resource
        for (org.glassfish.jersey.server.model.Resource r : resources) {
            Resource wadlResource = generateResource(r, r.getPath());
            if (wadlResource == null) {
                continue;
            }
            wadlResources.getResource().add(wadlResource);
        }
        wadlApplication.getResources().add(wadlResources);

        addVersion(wadlApplication);
        addHint(wadlApplication);

        // Build any external grammars
View Full Code Here

     */
    public Application generate(
            ApplicationDescription description,
            org.glassfish.jersey.server.model.Resource resource) {
        try {
            Application wadlApplication = _wadlGenerator.createApplication();
            Resources wadlResources = _wadlGenerator.createResources();
            Resource wadlResource = generateResource(resource, null);
            if (wadlResource == null) {
                return null;
            }
            wadlResources.getResource().add(wadlResource);
            wadlApplication.getResources().add(wadlResources);

            addVersion(wadlApplication);

            // Attach the data to the parts of the model

View Full Code Here

    /**
     * @return the application
     * @see org.glassfish.jersey.server.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

                this.lastModified = new SimpleDateFormat(HTTPDATEFORMAT).format(new Date());

                ApplicationDescription applicationDescription = wadlContext.getApplication(uriInfo,
                        detailedWadl);

                Application application = applicationDescription.getApplication();

                try {
                    final Marshaller marshaller = wadlContext.getJAXBContext().createMarshaller();
                    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
                    final ByteArrayOutputStream os = new ByteArrayOutputStream();
View Full Code Here

    /**
     * @return application
     * @see org.glassfish.jersey.server.wadl.WadlGenerator#createApplication()
     */
    public Application createApplication() {
        final Application result = _delegate.createApplication();
        if (result.getGrammars() != null && !overrideGrammars) {
            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

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.