Package javax.xml.bind

Examples of javax.xml.bind.JAXBContext.generateSchema()


                RestLogging.restLogger.log(Level.WARNING, null, ex);
            }
        }
        JAXBContext jc = JAXBContext.newInstance(classes.toArray(new Class<?>[classes.size()]));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        jc.generateSchema(new MySchemaOutputResolver(baos));
        return new String(baos.toByteArray());
    }

    @GET
    @Path("test1")
View Full Code Here


        } catch (ClassNotFoundException ex) {
            RestLogging.restLogger.log(Level.WARNING, null, ex);
        }
        JAXBContext jc = JAXBContext.newInstance(classes.toArray(new Class<?>[classes.size()]));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        jc.generateSchema(new MySchemaOutputResolver(baos));
        return new String(baos.toByteArray());
    }

    @GET
    public String getSchemaManually() {
View Full Code Here

        }

        if (jaxbContext == null) {
            throw new UnsupportedOperationException("Schema generation is not supported");
        }
        jaxbContext.generateSchema(outputResolver);
    }

    @SuppressWarnings("deprecation")
    public javax.xml.bind.Validator createValidator() throws JAXBException {
        throw new UnsupportedOperationException();
View Full Code Here

                baseDir.mkdirs();

            System.out.println("Generating schema file in " + baseDir.getAbsolutePath());
            try {
                JAXBContext context = JAXBContext.newInstance(InfinispanConfiguration.class);
                context.generateSchema(new InfinispanSchemaOutputResolver(baseDir));
                System.out.println("Generated schema file successfully");
            } catch (Exception e) {
                System.err.println("Failed generating schema file " + e);
                e.printStackTrace(System.err);
            }
View Full Code Here

        try {
            JAXBContext context = JAXBContext.newInstance(classSet.toArray(new Class[classSet.size()]));

            final List<StreamResult> results = new ArrayList<StreamResult>();

            context.generateSchema(new SchemaOutputResolver() {

                int counter = 0;

                @Override
                public Result createOutput(String namespaceUri, String suggestedFileName) {
View Full Code Here

            } else if (mediaType == MediaType.APPLICATION_XML) {
                JAXBContext jc = JAXBContext.newInstance(objectClass);
                // generate the schemas
                final ArrayList<ByteArrayOutputStream> schemaStreams = new ArrayList<ByteArrayOutputStream>();
                jc.generateSchema(new SchemaOutputResolver() {
                    @Override
                    public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        schemaStreams.add(out);
                        StreamResult streamResult = new StreamResult(out);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.