Package com.sun.xml.bind.marshaller

Examples of com.sun.xml.bind.marshaller.NamespacePrefixMapper


            mappings = Collections.emptyMap();
        }
       
        final Map<String, String> closedMappings = mappings;
       
        NamespacePrefixMapper mapper = new NamespacePrefixMapper() {
            @Override
            public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
                String prefix = closedMappings.get(namespaceUri);
                if (prefix != null) {
                    return prefix;
View Full Code Here


            mappings = Collections.emptyMap();
        }

        final Map<String, String> closedMappings = mappings;

        NamespacePrefixMapper mapper = new NamespacePrefixMapper() {
            @Override
            public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
                String prefix = closedMappings.get(namespaceUri);
                if (prefix != null) {
                    return prefix;
View Full Code Here

      }
      try
      {
         JAXBContext ctx = finder.findCacheContext(mediaType, annotations, set.toArray(new Class[set.size()]));
         Marshaller marshaller = ctx.createMarshaller();
         NamespacePrefixMapper mapper = new NamespacePrefixMapper()
         {
            public String getPreferredPrefix(String namespace, String s1, boolean b)
            {
               if (namespace.equals("http://www.w3.org/2005/Atom")) return "atom";
               else return s1;
View Full Code Here

      }
      try
      {
         JAXBContext ctx = finder.findCacheContext(mediaType, annotations, set.toArray(new Class[set.size()]));
         Marshaller marshaller = ctx.createMarshaller();
         NamespacePrefixMapper mapper = new NamespacePrefixMapper()
         {
            public String getPreferredPrefix(String namespace, String s1, boolean b)
            {
               if (namespace.equals("http://www.w3.org/2005/Atom")) return "atom";
               else return s1;
View Full Code Here

      marshaller.setProperty("com.sun.xml.bind.indentString", "   ");
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
      StringWriter writer = new StringWriter();

      NamespacePrefixMapper mapper = new NamespacePrefixMapper()
      {
         public String getPreferredPrefix(String namespace, String s1, boolean b)
         {
            if (namespace.equals("http://www.w3.org/2005/Atom"))
            {
View Full Code Here

      JAXBContext ctx = JAXBContext.newInstance(Feed.class);


      Marshaller marshaller = ctx.createMarshaller();

      NamespacePrefixMapper mapper = new NamespacePrefixMapper()
      {
         public String getPreferredPrefix(String namespace, String s1, boolean b)
         {
            if (namespace.equals("http://www.w3.org/2005/Atom")) return "atom";
            else return s1;
View Full Code Here

   {
      JAXBContext ctx = JAXBContext.newInstance(Feed.class);
      Feed feed = (Feed) ctx.createUnmarshaller().unmarshal(new StringReader(RFC_COMPLEX_XML));
      Marshaller marshaller = ctx.createMarshaller();

      NamespacePrefixMapper mapper = new NamespacePrefixMapper()
      {
         public String getPreferredPrefix(String namespace, String s1, boolean b)
         {
            if (namespace.equals("http://www.w3.org/2005/Atom")) return "atom";
            else return s1;
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.marshaller.NamespacePrefixMapper

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.