1 23 package com.sun.enterprise.deployment; 24 25 import java.util.Iterator ; 26 import java.util.Map ; 27 import java.util.HashMap ; 28 import java.util.Collection ; 29 import java.util.HashSet ; 30 31 37 38 public class JaxrpcMappingDescriptor extends Descriptor { 39 40 private Map packageToNamespaceUriMap = new HashMap (); 41 private Map namespaceUriToPackageMap = new HashMap (); 42 43 private boolean simpleMapping = true; 44 45 public JaxrpcMappingDescriptor() { 46 } 47 48 public void setSpecVersion(String version) { 49 } 51 52 public void setIsSimpleMapping(boolean flag) { 53 simpleMapping = flag; 54 } 55 56 60 public boolean isSimpleMapping() { 61 return simpleMapping; 62 } 63 64 public void addMapping(String javaPackage, String namespaceUri) { 65 packageToNamespaceUriMap.put(javaPackage, namespaceUri); 66 namespaceUriToPackageMap.put(namespaceUri, javaPackage); 67 } 68 69 72 public Collection getMappings() { 73 Collection mappings = new HashSet (); 74 for(Iterator nIter = namespaceUriToPackageMap.keySet().iterator(); 75 nIter.hasNext();) { 76 String namespaceUri = (String ) nIter.next(); 77 String javaPackage = (String ) 78 namespaceUriToPackageMap.get(namespaceUri); 79 Mapping mapping = new Mapping(namespaceUri, javaPackage); 80 mappings.add(mapping); 81 } 82 return mappings; 83 } 84 85 public static class Mapping { 86 private String namespaceUri; 87 private String javaPackage; 88 89 public Mapping(String namespace, String thePackage) { 90 namespaceUri = namespace; 91 javaPackage = thePackage; 92 } 93 94 public String getNamespaceUri() { 95 return namespaceUri; 96 } 97 98 public String getPackage() { 99 return javaPackage; 100 } 101 } 102 103 } 104 | Popular Tags |