Package com.sun.jersey.server.wadl.generators

Examples of com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator


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

    static WadlGenerator loadWadlGenerators(
            List<WadlGenerator> wadlGenerators) throws Exception {
        WadlGenerator wadlGenerator = new WadlGeneratorJAXBGrammarGenerator();
        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 WadlGeneratorJAXBGrammarGenerator();

        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

public class WadlBuilder {

    private WadlGenerator _wadlGenerator;

    public WadlBuilder() {
        this(new WadlGeneratorJAXBGrammarGenerator());
    }
View Full Code Here

            throw new MojoExecutionException( "The baseUri attribute is required but not defined." );
        }

        try {

            com.sun.jersey.server.wadl.WadlGenerator wadlGenerator = new WadlGeneratorJAXBGrammarGenerator();
            if ( _wadlGenerators != null ) {
                for ( WadlGeneratorDescription wadlGeneratorDescription : _wadlGenerators ) {
                    wadlGenerator = loadWadlGenerator( wadlGeneratorDescription, wadlGenerator );
                }
            }
            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(),
                    Thread.currentThread().getContextClassLoader() );
            final Marshaller m = c.createMarshaller();
            m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, _formatWadlFile );
            // m.setProperty( "com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapperImpl() );
            // m.setProperty( "com.sun.xml.bind.characterEscapeHandler", new CustomCharacterEscapeHandler() );
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 WadlGeneratorJAXBGrammarGenerator();
        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 WadlGeneratorJAXBGrammarGenerator();

        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

public class WadlBuilder {

    private WadlGenerator _wadlGenerator;

    public WadlBuilder() {
        this(new WadlGeneratorJAXBGrammarGenerator());
    }
View Full Code Here

            throw new MojoExecutionException( "The baseUri attribute is required but not defined." );
        }

        try {

            com.sun.jersey.server.wadl.WadlGenerator wadlGenerator = new WadlGeneratorJAXBGrammarGenerator();
            if ( _wadlGenerators != null ) {
                for ( WadlGeneratorDescription wadlGeneratorDescription : _wadlGenerators ) {
                    wadlGenerator = loadWadlGenerator( wadlGeneratorDescription, wadlGenerator );
                }
            }
            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(),
                    Thread.currentThread().getContextClassLoader() );
            final Marshaller m = c.createMarshaller();
            m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, _formatWadlFile );
            // m.setProperty( "com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapperImpl() );
            // m.setProperty( "com.sun.xml.bind.characterEscapeHandler", new CustomCharacterEscapeHandler() );
View Full Code Here

TOP

Related Classes of com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator

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.