Package javax.xml.bind

Examples of javax.xml.bind.SchemaOutputResolver


    /**
     * Used for testing.
     */
    public SchemaOutputResolver createTestResolver() {
        return new SchemaOutputResolver() {
            public Result createOutput(String namespaceUri, String suggestedFileName) {
                SAXResult r = new SAXResult(new DefaultHandler());
                r.setSystemId(suggestedFileName);
                return r;
            }
View Full Code Here


         Document doc = builder.newDocument();
         DOMTypes types = new DOMTypes(doc);
         final Element element = types.getElement();
         final Element throwAway = doc.createElement("throw-away");

         ctx.generateSchema(new SchemaOutputResolver()
         {
            @Override
            public Result createOutput(String namespace, String file) throws IOException
            {
               // JBWS-1295, getKnownNamespaceURIs is not accurate
View Full Code Here

    /**
     * Used for testing.
     */
    public SchemaOutputResolver createTestResolver() {
        return new SchemaOutputResolver() {
            public Result createOutput(String namespaceUri, String suggestedFileName) {
                SAXResult r = new SAXResult(new DefaultHandler());
                r.setSystemId(suggestedFileName);
                return r;
            }
View Full Code Here

  public static String getSchema(JAXBContext context, final String systemId) throws Exception
  {
    final StringWriter result = new StringWriter();
   
    context.generateSchema(
      new SchemaOutputResolver()
      {

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

   
    public static List<DOMResult> generateJaxbSchemas(
        JAXBContext context, final Map<String, DOMResult> builtIns) throws IOException {
        final List<DOMResult> results = new ArrayList<DOMResult>();

        context.generateSchema(new SchemaOutputResolver() {
            @Override
            public Result createOutput(String ns, String file) throws IOException {
                DOMResult result = new DOMResult();
               
                if (builtIns.containsKey(ns)) {
View Full Code Here

    /**
     * Used for testing.
     */
    public SchemaOutputResolver createTestResolver() {
        return new SchemaOutputResolver() {
            public Result createOutput(String namespaceUri, String suggestedFileName) {
                SAXResult r = new SAXResult(new DefaultHandler());
                r.setSystemId(suggestedFileName);
                return r;
            }
View Full Code Here

                if(model==null)
                    return; // error

                try {
                    model.generateSchema(
                        new SchemaOutputResolver() {
                            public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
                                File file;
                                OutputStream out;
                                if(schemaLocations.containsKey(namespaceUri)) {
                                    file = schemaLocations.get(namespaceUri);
View Full Code Here

                        Collection<Reference> classesToBeIncluded = configReader.getClassesToBeIncluded();
                        J2SJAXBModel model = XJC.createJavaCompiler().bind(
                                classesToBeIncluded,Collections.<QName,Reference>emptyMap(),null,env);

                        SchemaOutputResolver schemaOutputResolver = configReader.getSchemaOutputResolver();

                        model.generateSchema(schemaOutputResolver,errorListener);
                    } catch (IOException e) {
                        errorListener.error(e.getMessage(),e);
                    } catch (SAXException e) {
View Full Code Here

    /**
     * Used for testing.
     */
    public SchemaOutputResolver createTestResolver() {
        return new SchemaOutputResolver() {
            public Result createOutput(String namespaceUri, String suggestedFileName) {
                SAXResult r = new SAXResult(new DefaultHandler());
                r.setSystemId(suggestedFileName);
                return r;
            }
View Full Code Here

    }

    private List<DOMResult> generateJaxbSchemas() throws IOException {
        final List<DOMResult> results = new ArrayList<DOMResult>();

        context.generateSchema(new SchemaOutputResolver() {
            private Map<String, String> builtIns = new HashMap<String, String>();
            {
                builtIns.put("http://www.w3.org/2005/02/addressing/wsdl",
                             "classpath:/schemas/wsdl/ws-addr-wsdl.xsd");
                builtIns.put("http://www.w3.org/2005/08/addressing", "classpath:/schemas/wsdl/ws-addr.xsd");
View Full Code Here

TOP

Related Classes of javax.xml.bind.SchemaOutputResolver

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.