Examples of NamespacePrefixMapper


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

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

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

      }
      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

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

      }
      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

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

      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

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

      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

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

   {
      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

Examples of org.apache.commons.betwixt.strategy.NamespacePrefixMapper

        securityRoles.add(securityRole);
    }

    public void write(Writer outputWriter) throws IOException {
        //
        NamespacePrefixMapper nspm = new NamespacePrefixMapper();
        nspm.setPrefix(XSI.uri, "xsi");
        nspm.setPrefix("http://java.sun.com/xml/ns/j2ee", "xmlns");
        //

        outputWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");

        BeanWriter beanWriter = new BeanWriter(outputWriter);
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespacePrefixMapper

                xmlMarshaller.setNoNamespaceSchemaLocation((String) value);
            } else if(MarshallerProperties.NAMESPACE_PREFIX_MAPPER.equals(key)) {
              if(value == null){
                xmlMarshaller.setNamespacePrefixMapper(null);
              }else if(value instanceof Map){
                NamespacePrefixMapper namespacePrefixMapper = new MapNamespacePrefixMapper((Map)value);
                xmlMarshaller.setNamespacePrefixMapper(namespacePrefixMapper);
              }else{
                    xmlMarshaller.setNamespacePrefixMapper((NamespacePrefixMapper)value);
              }
            } else if(SUN_NAMESPACE_PREFIX_MAPPER.equals(key) || SUN_JSE_NAMESPACE_PREFIX_MAPPER.equals(key)) {
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespacePrefixMapper

                xmlMarshaller.setNoNamespaceSchemaLocation((String) value);
            } else if(MarshallerProperties.NAMESPACE_PREFIX_MAPPER.equals(key)) {
              if(value == null){
                xmlMarshaller.setNamespacePrefixMapper(null);
              }else if(value instanceof Map){
                NamespacePrefixMapper namespacePrefixMapper = new MapNamespacePrefixMapper((Map)value);
                xmlMarshaller.setNamespacePrefixMapper(namespacePrefixMapper);
              }else{
                    xmlMarshaller.setNamespacePrefixMapper((NamespacePrefixMapper)value);
              }
            } else if(SUN_NAMESPACE_PREFIX_MAPPER.equals(key) || SUN_JSE_NAMESPACE_PREFIX_MAPPER.equals(key)) {
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.