01: /*
02: * The contents of this file are subject to the terms
03: * of the Common Development and Distribution License
04: * (the License). You may not use this file except in
05: * compliance with the License.
06: *
07: * You can obtain a copy of the license at
08: * https://glassfish.dev.java.net/public/CDDLv1.0.html.
09: * See the License for the specific language governing
10: * permissions and limitations under the License.
11: *
12: * When distributing Covered Code, include this CDDL
13: * Header Notice in each file and include the License file
14: * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
15: * If applicable, add the following below the CDDL Header,
16: * with the fields enclosed by brackets [] replaced by
17: * you own identifying information:
18: * "Portions Copyrighted [year] [name of copyright owner]"
19: *
20: * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
21: */
22:
23: package com.sun.xml.ws.security.opt.impl.util;
24:
25: import java.util.ArrayList;
26: import java.util.List;
27: import org.jvnet.staxex.NamespaceContextEx;
28:
29: /**
30: *
31: * @author Ashutosh.Shahi@sun.com
32: */
33: public class NamespaceAndPrefixMapper {
34:
35: public static final String NS_PREFIX_MAPPER = "NS_And_Prefix_Mapper";
36:
37: NamespaceContextEx ns = null;
38: List<String> incList = null;
39:
40: /** Creates a new instance of NamespaceAndPrefixMapper */
41: public NamespaceAndPrefixMapper(NamespaceContextEx ns,
42: boolean disableIncPrefix) {
43: this .ns = ns;
44: incList = new ArrayList<String>();
45: if (!disableIncPrefix) {
46: incList.add("wsse");
47: incList.add("S");
48: }
49: }
50:
51: public NamespaceAndPrefixMapper(NamespaceContextEx ns,
52: List<String> incList) {
53: this .ns = ns;
54: this .incList = incList;
55: }
56:
57: public void setNamespaceContext(NamespaceContextEx ns) {
58: this .ns = ns;
59: }
60:
61: public NamespaceContextEx getNamespaceContext() {
62: return ns;
63: }
64:
65: public void addToInclusivePrefixList(String s) {
66: if (incList == null)
67: incList = new ArrayList<String>();
68: incList.add(s);
69: }
70:
71: public void removeFromInclusivePrefixList(String s) {
72: if (incList == null)
73: return;
74: incList.remove(s);
75: }
76:
77: public List<String> getInlusivePrefixList() {
78: return incList;
79: }
80: }
|