KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > impl > xs > XSWildcardDecl


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
6  * reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Xerces" and "Apache Software Foundation" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache",
33  * nor may "Apache" appear in their name, without prior written
34  * permission of the Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of the Apache Software Foundation and was
52  * originally based on software copyright (c) 1999, International
53  * Business Machines, Inc., http://www.apache.org. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  */

57
58 package com.sun.org.apache.xerces.internal.impl.xs;
59
60 import com.sun.org.apache.xerces.internal.xs.StringList;
61 import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
62 import com.sun.org.apache.xerces.internal.xs.XSConstants;
63 import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
64 import com.sun.org.apache.xerces.internal.xs.XSWildcard;
65 import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
66
67 /**
68  * The XML representation for a wildcard declaration
69  * schema component is an <any> or <anyAttribute> element information item
70  *
71  * @author Sandy Gao, IBM
72  * @author Rahul Srivastava, Sun Microsystems Inc.
73  *
74  * @version $Id: XSWildcardDecl.java,v 1.15 2003/11/11 20:14:59 sandygao Exp $
75  */

76 public class XSWildcardDecl implements XSWildcard {
77
78     public static final String JavaDoc ABSENT = null;
79
80     // the type of wildcard: any, other, or list
81
public short fType = NSCONSTRAINT_ANY;
82     // the type of process contents: strict, lax, or skip
83
public short fProcessContents = PC_STRICT;
84     // the namespace list:
85
// for NSCONSTRAINT_LIST, it means one of the namespaces in the list
86
// for NSCONSTRAINT_NOT, it means not any of the namespaces in the list
87
public String JavaDoc[] fNamespaceList;
88
89     // optional annotation
90
public XSAnnotationImpl fAnnotation = null;
91
92     // I'm trying to implement the following constraint exactly as what the
93
// spec describes. Sometimes it seems redundant, and sometimes there seems
94
// to be much easier solutions. But it makes it easy to understand,
95
// easy to maintain, and easy to find a bug (either in the code, or in the
96
// spec). -SG
97
//
98
// NOTE: Schema spec only requires that ##other not(tNS,absent).
99
// The way we store ##other is not(NS1,NS2,...,NSN), which covers
100
// what's required by Schema, and allows future enhanced features.
101
//
102
// In the following in-line comments:
103
// - Bullet removed from w3c specification.
104
// + Bullet added as proposed by Sandy Gao, IBM.
105
// / Since we store ##other as not(NS1,NS2,...,NSN), we need to put some
106
// comments on where we didn't follow the spec exactly.
107
// * When we really support not(NS1,NS2,...,NSN), we need to revisit these items.
108

109     /**
110      * Validation Rule: Wildcard allows Namespace Name
111      */

112     public boolean allowNamespace(String JavaDoc namespace) {
113         // For a value which is either a namespace name or absent to be valid with respect to a wildcard constraint (the value of a {namespace constraint}) one of the following must be true:
114

115         // 1 The constraint must be any.
116
if (fType == NSCONSTRAINT_ANY)
117             return true;
118
119         // 2 All of the following must be true:
120
// 2.1 The constraint is a pair of not and a namespace name or absent ([Definition:] call this the namespace test).
121
// 2.2 The value must not be identical to the namespace test.
122
// 2.3 The value must not be absent.
123
// / we store ##other as not(list), so our actual rule is
124
// / 2 The constraint is a pair of not and a set, and the value is not in such set.
125
if (fType == NSCONSTRAINT_NOT) {
126             boolean found = false;
127             int listNum = fNamespaceList.length;
128             for (int i = 0; i < listNum && !found; i++) {
129                 if (namespace == fNamespaceList[i])
130                     found = true;
131             }
132
133             if (!found)
134                 return true;
135         }
136
137         // 3 The constraint is a set, and the value is identical to one of the members of the set.
138
if (fType == NSCONSTRAINT_LIST) {
139             int listNum = fNamespaceList.length;
140             for (int i = 0; i < listNum; i++) {
141                 if (namespace == fNamespaceList[i])
142                     return true;
143             }
144         }
145
146         // none of the above conditions applied, so return false.
147
return false;
148     }
149
150     /**
151      * Schema Component Constraint: Wildcard Subset
152      */

153     public boolean isSubsetOf(XSWildcardDecl superWildcard) {
154         // if the super is null (not expressible), return false
155
if (superWildcard == null)
156             return false;
157
158         // For a namespace constraint (call it sub) to be an intensional subset of another
159
// namespace constraint (call it super) one of the following must be true:
160

161         // 1 super must be any.
162
if (superWildcard.fType == NSCONSTRAINT_ANY) {
163             return true;
164         }
165
166         // 2 All of the following must be true:
167
// 2.1 sub must be a pair of not and a namespace name or absent.
168
// 2.2 super must be a pair of not and the same value.
169
// * we can't just compare whether the namespace are the same value
170
// since we store other as not(list)
171
if (fType == NSCONSTRAINT_NOT) {
172             if (superWildcard.fType == NSCONSTRAINT_NOT &&
173                 fNamespaceList[0] == superWildcard.fNamespaceList[0]) {
174                 return true;
175             }
176         }
177
178         // 3 All of the following must be true:
179
// 3.1 sub must be a set whose members are either namespace names or absent.
180
// 3.2 One of the following must be true:
181
// 3.2.1 super must be the same set or a superset thereof.
182
// -3.2.2 super must be a pair of not and a namespace name or absent and
183
// that value must not be in sub's set.
184
// +3.2.2 super must be a pair of not and a namespace name or absent and
185
// either that value or absent must not be in sub's set.
186
// * since we store ##other as not(list), we acturally need to make sure
187
// that none of the namespaces in super.list is in sub.list.
188
if (fType == NSCONSTRAINT_LIST) {
189             if (superWildcard.fType == NSCONSTRAINT_LIST &&
190                 subset2sets(fNamespaceList, superWildcard.fNamespaceList)) {
191                 return true;
192             }
193
194             if (superWildcard.fType == NSCONSTRAINT_NOT &&
195                 !elementInSet(superWildcard.fNamespaceList[0], fNamespaceList) &&
196                 !elementInSet(ABSENT, fNamespaceList)) {
197                 return true;
198             }
199         }
200
201         // none of the above conditions applied, so return false.
202
return false;
203
204     } // isSubsetOf
205

206     /**
207      * Check whether this wildcard has a weaker process contents than the super.
208      */

209     public boolean weakerProcessContents(XSWildcardDecl superWildcard) {
210         return fProcessContents == XSWildcardDecl.PC_LAX &&
211                superWildcard.fProcessContents == XSWildcardDecl.PC_STRICT ||
212                fProcessContents == XSWildcardDecl.PC_SKIP &&
213                superWildcard.fProcessContents != XSWildcardDecl.PC_SKIP;
214     }
215
216     /**
217      * Schema Component Constraint: Attribute Wildcard Union
218      */

219     public XSWildcardDecl performUnionWith(XSWildcardDecl wildcard,
220                                            short processContents) {
221         // if the other wildcard is not expressible, the result is still not expressible
222
if (wildcard == null)
223             return null;
224
225         // For a wildcard's {namespace constraint} value to be the intensional union of two
226
// other such values (call them O1 and O2): the appropriate case among the following
227
// must be true:
228

229         XSWildcardDecl unionWildcard = new XSWildcardDecl();
230         unionWildcard.fProcessContents = processContents;
231
232         // 1 If O1 and O2 are the same value, then that value must be the value.
233
if (areSame(wildcard)) {
234             unionWildcard.fType = fType;
235             unionWildcard.fNamespaceList = fNamespaceList;
236         }
237
238         // 2 If either O1 or O2 is any, then any must be the value.
239
else if ( (fType == NSCONSTRAINT_ANY) || (wildcard.fType == NSCONSTRAINT_ANY) ) {
240             unionWildcard.fType = NSCONSTRAINT_ANY;
241         }
242
243         // 3 If both O1 and O2 are sets of (namespace names or absent), then the union of
244
// those sets must be the value.
245
else if ( (fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_LIST) ) {
246             unionWildcard.fType = NSCONSTRAINT_LIST;
247             unionWildcard.fNamespaceList = union2sets(fNamespaceList, wildcard.fNamespaceList);
248         }
249
250         // -4 If the two are negations of different namespace names, then the intersection
251
// is not expressible.
252
// +4 If the two are negations of different namespace names or absent, then
253
// a pair of not and absent must be the value.
254
// * now we store ##other as not(list), the result should be
255
// not(intersection of two lists).
256
else if (fType == NSCONSTRAINT_NOT && wildcard.fType == NSCONSTRAINT_NOT) {
257             unionWildcard.fType = NSCONSTRAINT_NOT;
258             unionWildcard.fNamespaceList = new String JavaDoc[2];
259             unionWildcard.fNamespaceList[0] = ABSENT;
260             unionWildcard.fNamespaceList[1] = ABSENT;
261         }
262
263         // 5 If either O1 or O2 is a pair of not and a namespace name and the other is a set of
264
// (namespace names or absent), then The appropriate case among the following must be true:
265
// -5.1 If the set includes the negated namespace name, then any must be the value.
266
// -5.2 If the set does not include the negated namespace name, then whichever of O1 or O2
267
// is a pair of not and a namespace name must be the value.
268
// +5.1 If the negated value is a namespace name, then The appropriate case
269
// among the following must be true:
270
// +5.1.1 If the set includes both the namespace name and absent, then any
271
// must be the value.
272
// +5.1.2 If the set includes the namespace name but does not include
273
// absent, then a pair of not and absent must be the value.
274
// +5.1.3 If the set does not include the namespace name but includes
275
// absent, then the union is not expressible.
276
// +5.1.4 If the set does not include either the namespace name or absent,
277
// then whichever of O1 or O2 is a pair of not and a namespace name must be
278
// the value.
279
// +5.2 If the negated value is absent, then The appropriate case among the
280
// following must be true:
281
// +5.2.1 If the set includes absent, then any must be the value.
282
// +5.2.2 If the set does not include absent, then whichever of O1 or O2 is
283
// a pair of not and a namespace name must be the value.
284
// * when we have not(list), the operation is just not(otherlist-list)
285
else if ( ((fType == NSCONSTRAINT_NOT) && (wildcard.fType == NSCONSTRAINT_LIST)) ||
286                   ((fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_NOT)) ) {
287             String JavaDoc[] other = null;
288             String JavaDoc[] list = null;
289
290             if (fType == NSCONSTRAINT_NOT) {
291                 other = fNamespaceList;
292                 list = wildcard.fNamespaceList;
293             }
294             else {
295                 other = wildcard.fNamespaceList;
296                 list = fNamespaceList;
297             }
298
299             boolean foundAbsent = elementInSet(ABSENT, list);
300
301             if (other[0] != ABSENT) {
302                 boolean foundNS = elementInSet(other[0], list);
303                 if (foundNS && foundAbsent) {
304                     unionWildcard.fType = NSCONSTRAINT_ANY;
305                 } else if (foundNS && !foundAbsent) {
306                     unionWildcard.fType = NSCONSTRAINT_NOT;
307                     unionWildcard.fNamespaceList = new String JavaDoc[2];
308                     unionWildcard.fNamespaceList[0] = ABSENT;
309                     unionWildcard.fNamespaceList[1] = ABSENT;
310                 } else if (!foundNS && foundAbsent) {
311                     return null;
312                 } else { // !foundNS && !foundAbsent
313
unionWildcard.fType = NSCONSTRAINT_NOT;
314                     unionWildcard.fNamespaceList = other;
315                 }
316             } else { // other[0] == ABSENT
317
if (foundAbsent) {
318                     unionWildcard.fType = NSCONSTRAINT_ANY;
319                 } else { // !foundAbsent
320
unionWildcard.fType = NSCONSTRAINT_NOT;
321                     unionWildcard.fNamespaceList = other;
322                 }
323             }
324         }
325
326         return unionWildcard;
327
328     } // performUnionWith
329

330     /**
331      * Schema Component Constraint: Attribute Wildcard Intersection
332      */

333     public XSWildcardDecl performIntersectionWith(XSWildcardDecl wildcard,
334                                                   short processContents) {
335         // if the other wildcard is not expressible, the result is still not expressible
336
if (wildcard == null)
337             return null;
338
339         // For a wildcard's {namespace constraint} value to be the intensional intersection of
340
// two other such values (call them O1 and O2): the appropriate case among the following
341
// must be true:
342

343         XSWildcardDecl intersectWildcard = new XSWildcardDecl();
344         intersectWildcard.fProcessContents = processContents;
345
346         // 1 If O1 and O2 are the same value, then that value must be the value.
347
if (areSame(wildcard)) {
348             intersectWildcard.fType = fType;
349             intersectWildcard.fNamespaceList = fNamespaceList;
350         }
351
352         // 2 If either O1 or O2 is any, then the other must be the value.
353
else if ( (fType == NSCONSTRAINT_ANY) || (wildcard.fType == NSCONSTRAINT_ANY) ) {
354             // both cannot be ANY, if we have reached here.
355
XSWildcardDecl other = this;
356
357             if (fType == NSCONSTRAINT_ANY)
358                 other = wildcard;
359
360             intersectWildcard.fType = other.fType;
361             intersectWildcard.fNamespaceList = other.fNamespaceList;
362         }
363
364         // -3 If either O1 or O2 is a pair of not and a namespace name and the other is a set of
365
// (namespace names or absent), then that set, minus the negated namespace name if
366
// it was in the set, must be the value.
367
// +3 If either O1 or O2 is a pair of not and a namespace name and the other
368
// is a set of (namespace names or absent), then that set, minus the negated
369
// namespace name if it was in the set, then minus absent if it was in the
370
// set, must be the value.
371
// * when we have not(list), the operation is just list-otherlist
372
else if ( ((fType == NSCONSTRAINT_NOT) && (wildcard.fType == NSCONSTRAINT_LIST)) ||
373                   ((fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_NOT)) ) {
374             String JavaDoc[] list = null;
375             String JavaDoc[] other = null;
376
377             if (fType == NSCONSTRAINT_NOT) {
378                 other = fNamespaceList;
379                 list = wildcard.fNamespaceList;
380             }
381             else {
382                 other = wildcard.fNamespaceList;
383                 list = fNamespaceList;
384             }
385
386             int listSize = list.length;
387             String JavaDoc[] intersect = new String JavaDoc[listSize];
388             int newSize = 0;
389             for (int i = 0; i < listSize; i++) {
390                 if (list[i] != other[0] && list[i] != ABSENT)
391                     intersect[newSize++] = list[i];
392             }
393
394             intersectWildcard.fType = NSCONSTRAINT_LIST;
395             intersectWildcard.fNamespaceList = new String JavaDoc[newSize];
396             System.arraycopy(intersect, 0, intersectWildcard.fNamespaceList, 0, newSize);
397         }
398
399         // 4 If both O1 and O2 are sets of (namespace names or absent), then the intersection of those
400
// sets must be the value.
401
else if ( (fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_LIST) ) {
402             intersectWildcard.fType = NSCONSTRAINT_LIST;
403             intersectWildcard.fNamespaceList = intersect2sets(fNamespaceList, wildcard.fNamespaceList);
404         }
405
406         // -5 If the two are negations of different namespace names, then the intersection is not expressible.
407
// +5 If the two are negations of namespace names or absent, then The
408
// appropriate case among the following must be true:
409
// +5.1 If the two are negations of different namespace names, then the
410
// intersection is not expressible.
411
// +5.2 If one of the two is a pair of not and absent, the other must be
412
// the value.
413
// * when we have not(list), the operation is just not(onelist+otherlist)
414
else if (fType == NSCONSTRAINT_NOT && wildcard.fType == NSCONSTRAINT_NOT) {
415             if (fNamespaceList[0] != ABSENT && wildcard.fNamespaceList[0] != ABSENT)
416                 return null;
417
418             XSWildcardDecl other = this;
419             if (fNamespaceList[0] == ABSENT)
420                 other = wildcard;
421
422             intersectWildcard.fType = other.fType;
423             intersectWildcard.fNamespaceList = other.fNamespaceList;
424         }
425
426         return intersectWildcard;
427
428     } // performIntersectionWith
429

430     private boolean areSame(XSWildcardDecl wildcard) {
431         if (fType == wildcard.fType) {
432             // ##any, true
433
if (fType == NSCONSTRAINT_ANY)
434                 return true;
435
436             // ##other, only check the negated value
437
// * when we support not(list), we need to check in the same way
438
// as for NSCONSTRAINT_LIST.
439
if (fType == NSCONSTRAINT_NOT)
440                 return fNamespaceList[0] == wildcard.fNamespaceList[0];
441
442             // ## list, must have the same length,
443
// and each item in one list must appear in the other one
444
// (we are assuming that there are no duplicate items in a list)
445
if (fNamespaceList.length == wildcard.fNamespaceList.length) {
446                 for (int i=0; i<fNamespaceList.length; i++) {
447                     if (!elementInSet(fNamespaceList[i], wildcard.fNamespaceList))
448                         return false;
449                 }
450                 return true;
451             }
452         }
453
454         return false;
455     } // areSame
456

457     String JavaDoc[] intersect2sets(String JavaDoc[] one, String JavaDoc[] theOther){
458         String JavaDoc[] result = new String JavaDoc[Math.min(one.length,theOther.length)];
459
460         // simple implemention,
461
int count = 0;
462         for (int i=0; i<one.length; i++) {
463             if (elementInSet(one[i], theOther))
464                 result[count++] = one[i];
465         }
466
467         String JavaDoc[] result2 = new String JavaDoc[count];
468         System.arraycopy(result, 0, result2, 0, count);
469
470         return result2;
471     }
472
473     String JavaDoc[] union2sets(String JavaDoc[] one, String JavaDoc[] theOther){
474         String JavaDoc[] result1 = new String JavaDoc[one.length];
475
476         // simple implemention,
477
int count = 0;
478         for (int i=0; i<one.length; i++) {
479             if (!elementInSet(one[i], theOther))
480                 result1[count++] = one[i];
481         }
482
483         String JavaDoc[] result2 = new String JavaDoc[count+theOther.length];
484         System.arraycopy(result1, 0, result2, 0, count);
485         System.arraycopy(theOther, 0, result2, count, theOther.length);
486
487         return result2;
488     }
489
490     boolean subset2sets(String JavaDoc[] subSet, String JavaDoc[] superSet){
491         for (int i=0; i<subSet.length; i++) {
492             if (!elementInSet(subSet[i], superSet))
493                 return false;
494         }
495
496         return true;
497     }
498
499     boolean elementInSet(String JavaDoc ele, String JavaDoc[] set){
500         boolean found = false;
501         for (int i=0; i<set.length && !found; i++) {
502             if (ele==set[i])
503                 found = true;
504         }
505
506         return found;
507     }
508
509     /**
510      * get the string description of this wildcard
511      */

512     private String JavaDoc fDescription = null;
513     public String JavaDoc toString() {
514         if (fDescription == null) {
515             StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
516             buffer.append("WC[");
517             switch (fType) {
518             case NSCONSTRAINT_ANY:
519                 buffer.append(SchemaSymbols.ATTVAL_TWOPOUNDANY);
520                 break;
521             case NSCONSTRAINT_NOT:
522                 buffer.append(SchemaSymbols.ATTVAL_TWOPOUNDOTHER);
523                 buffer.append(":\"");
524                 if (fNamespaceList[0] != null)
525                     buffer.append(fNamespaceList[0]);
526                 buffer.append("\"");
527                 break;
528             case NSCONSTRAINT_LIST:
529                 if (fNamespaceList.length == 0)
530                     break;
531                 buffer.append("\"");
532                 if (fNamespaceList[0] != null)
533                     buffer.append(fNamespaceList[0]);
534                 buffer.append("\"");
535                 for (int i = 1; i < fNamespaceList.length; i++) {
536                     buffer.append(",\"");
537                     if (fNamespaceList[i] != null)
538                         buffer.append(fNamespaceList[i]);
539                     buffer.append("\"");
540                 }
541                 break;
542             }
543             buffer.append("]");
544             fDescription = buffer.toString();
545         }
546
547         return fDescription;
548     }
549     
550     /**
551      * Get the type of the object, i.e ELEMENT_DECLARATION.
552      */

553     public short getType() {
554         return XSConstants.WILDCARD;
555     }
556
557     /**
558      * The <code>name</code> of this <code>XSObject</code> depending on the
559      * <code>XSObject</code> type.
560      */

561     public String JavaDoc getName() {
562         return null;
563     }
564
565     /**
566      * The namespace URI of this node, or <code>null</code> if it is
567      * unspecified. defines how a namespace URI is attached to schema
568      * components.
569      */

570     public String JavaDoc getNamespace() {
571         return null;
572     }
573
574     /**
575      * Namespace constraint: A constraint type: any, not, list.
576      */

577     public short getConstraintType() {
578         return fType;
579     }
580
581     /**
582      * Namespace constraint. For <code>constraintType</code>
583      * LIST_NSCONSTRAINT, the list contains allowed namespaces. For
584      * <code>constraintType</code> NOT_NSCONSTRAINT, the list contains
585      * disallowed namespaces.
586      */

587     public StringList getNsConstraintList() {
588         return new StringListImpl(fNamespaceList, fNamespaceList == null ? 0 : fNamespaceList.length);
589     }
590
591     /**
592      * {process contents} One of skip, lax or strict. Valid constants values
593      * are: PC_SKIP, PC_LAX, PC_STRICT.
594      */

595     public short getProcessContents() {
596         return fProcessContents;
597     }
598
599     /**
600      * String valid of {process contents}. One of "skip", "lax" or "strict".
601      */

602     public String JavaDoc getProcessContentsAsString() {
603         switch (fProcessContents) {
604             case XSWildcardDecl.PC_SKIP: return "skip";
605             case XSWildcardDecl.PC_LAX: return "lax";
606             case XSWildcardDecl.PC_STRICT: return "strict";
607             default: return "invalid value";
608         }
609     }
610
611     /**
612      * Optional. Annotation.
613      */

614     public XSAnnotation getAnnotation() {
615         return fAnnotation;
616     }
617
618
619     /**
620      * @see com.sun.org.apache.xerces.internal.xs.XSObject#getNamespaceItem()
621      */

622     public XSNamespaceItem getNamespaceItem() {
623         // REVISIT: implement
624
return null;
625     }
626
627 } // class XSWildcardDecl
628
Popular Tags