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. package com.sun.org.apache.xerces.internal.impl.xs;
  58. import com.sun.org.apache.xerces.internal.xs.StringList;
  59. import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
  60. import com.sun.org.apache.xerces.internal.xs.XSConstants;
  61. import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
  62. import com.sun.org.apache.xerces.internal.xs.XSWildcard;
  63. import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
  64. /**
  65. * The XML representation for a wildcard declaration
  66. * schema component is an <any> or <anyAttribute> element information item
  67. *
  68. * @author Sandy Gao, IBM
  69. * @author Rahul Srivastava, Sun Microsystems Inc.
  70. *
  71. * @version $Id: XSWildcardDecl.java,v 1.15 2003/11/11 20:14:59 sandygao Exp $
  72. */
  73. public class XSWildcardDecl implements XSWildcard {
  74. public static final String ABSENT = null;
  75. // the type of wildcard: any, other, or list
  76. public short fType = NSCONSTRAINT_ANY;
  77. // the type of process contents: strict, lax, or skip
  78. public short fProcessContents = PC_STRICT;
  79. // the namespace list:
  80. // for NSCONSTRAINT_LIST, it means one of the namespaces in the list
  81. // for NSCONSTRAINT_NOT, it means not any of the namespaces in the list
  82. public String[] fNamespaceList;
  83. // optional annotation
  84. public XSAnnotationImpl fAnnotation = null;
  85. // I'm trying to implement the following constraint exactly as what the
  86. // spec describes. Sometimes it seems redundant, and sometimes there seems
  87. // to be much easier solutions. But it makes it easy to understand,
  88. // easy to maintain, and easy to find a bug (either in the code, or in the
  89. // spec). -SG
  90. //
  91. // NOTE: Schema spec only requires that ##other not(tNS,absent).
  92. // The way we store ##other is not(NS1,NS2,...,NSN), which covers
  93. // what's required by Schema, and allows future enhanced features.
  94. //
  95. // In the following in-line comments:
  96. // - Bullet removed from w3c specification.
  97. // + Bullet added as proposed by Sandy Gao, IBM.
  98. // / Since we store ##other as not(NS1,NS2,...,NSN), we need to put some
  99. // comments on where we didn't follow the spec exactly.
  100. // * When we really support not(NS1,NS2,...,NSN), we need to revisit these items.
  101. /**
  102. * Validation Rule: Wildcard allows Namespace Name
  103. */
  104. public boolean allowNamespace(String namespace) {
  105. // 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:
  106. // 1 The constraint must be any.
  107. if (fType == NSCONSTRAINT_ANY)
  108. return true;
  109. // 2 All of the following must be true:
  110. // 2.1 The constraint is a pair of not and a namespace name or absent ([Definition:] call this the namespace test).
  111. // 2.2 The value must not be identical to the namespace test.
  112. // 2.3 The value must not be absent.
  113. // / we store ##other as not(list), so our actual rule is
  114. // / 2 The constraint is a pair of not and a set, and the value is not in such set.
  115. if (fType == NSCONSTRAINT_NOT) {
  116. boolean found = false;
  117. int listNum = fNamespaceList.length;
  118. for (int i = 0; i < listNum && !found; i++) {
  119. if (namespace == fNamespaceList[i])
  120. found = true;
  121. }
  122. if (!found)
  123. return true;
  124. }
  125. // 3 The constraint is a set, and the value is identical to one of the members of the set.
  126. if (fType == NSCONSTRAINT_LIST) {
  127. int listNum = fNamespaceList.length;
  128. for (int i = 0; i < listNum; i++) {
  129. if (namespace == fNamespaceList[i])
  130. return true;
  131. }
  132. }
  133. // none of the above conditions applied, so return false.
  134. return false;
  135. }
  136. /**
  137. * Schema Component Constraint: Wildcard Subset
  138. */
  139. public boolean isSubsetOf(XSWildcardDecl superWildcard) {
  140. // if the super is null (not expressible), return false
  141. if (superWildcard == null)
  142. return false;
  143. // For a namespace constraint (call it sub) to be an intensional subset of another
  144. // namespace constraint (call it super) one of the following must be true:
  145. // 1 super must be any.
  146. if (superWildcard.fType == NSCONSTRAINT_ANY) {
  147. return true;
  148. }
  149. // 2 All of the following must be true:
  150. // 2.1 sub must be a pair of not and a namespace name or absent.
  151. // 2.2 super must be a pair of not and the same value.
  152. // * we can't just compare whether the namespace are the same value
  153. // since we store other as not(list)
  154. if (fType == NSCONSTRAINT_NOT) {
  155. if (superWildcard.fType == NSCONSTRAINT_NOT &&
  156. fNamespaceList[0] == superWildcard.fNamespaceList[0]) {
  157. return true;
  158. }
  159. }
  160. // 3 All of the following must be true:
  161. // 3.1 sub must be a set whose members are either namespace names or absent.
  162. // 3.2 One of the following must be true:
  163. // 3.2.1 super must be the same set or a superset thereof.
  164. // -3.2.2 super must be a pair of not and a namespace name or absent and
  165. // that value must not be in sub's set.
  166. // +3.2.2 super must be a pair of not and a namespace name or absent and
  167. // either that value or absent must not be in sub's set.
  168. // * since we store ##other as not(list), we acturally need to make sure
  169. // that none of the namespaces in super.list is in sub.list.
  170. if (fType == NSCONSTRAINT_LIST) {
  171. if (superWildcard.fType == NSCONSTRAINT_LIST &&
  172. subset2sets(fNamespaceList, superWildcard.fNamespaceList)) {
  173. return true;
  174. }
  175. if (superWildcard.fType == NSCONSTRAINT_NOT &&
  176. !elementInSet(superWildcard.fNamespaceList[0], fNamespaceList) &&
  177. !elementInSet(ABSENT, fNamespaceList)) {
  178. return true;
  179. }
  180. }
  181. // none of the above conditions applied, so return false.
  182. return false;
  183. } // isSubsetOf
  184. /**
  185. * Check whether this wildcard has a weaker process contents than the super.
  186. */
  187. public boolean weakerProcessContents(XSWildcardDecl superWildcard) {
  188. return fProcessContents == XSWildcardDecl.PC_LAX &&
  189. superWildcard.fProcessContents == XSWildcardDecl.PC_STRICT ||
  190. fProcessContents == XSWildcardDecl.PC_SKIP &&
  191. superWildcard.fProcessContents != XSWildcardDecl.PC_SKIP;
  192. }
  193. /**
  194. * Schema Component Constraint: Attribute Wildcard Union
  195. */
  196. public XSWildcardDecl performUnionWith(XSWildcardDecl wildcard,
  197. short processContents) {
  198. // if the other wildcard is not expressible, the result is still not expressible
  199. if (wildcard == null)
  200. return null;
  201. // For a wildcard's {namespace constraint} value to be the intensional union of two
  202. // other such values (call them O1 and O2): the appropriate case among the following
  203. // must be true:
  204. XSWildcardDecl unionWildcard = new XSWildcardDecl();
  205. unionWildcard.fProcessContents = processContents;
  206. // 1 If O1 and O2 are the same value, then that value must be the value.
  207. if (areSame(wildcard)) {
  208. unionWildcard.fType = fType;
  209. unionWildcard.fNamespaceList = fNamespaceList;
  210. }
  211. // 2 If either O1 or O2 is any, then any must be the value.
  212. else if ( (fType == NSCONSTRAINT_ANY) || (wildcard.fType == NSCONSTRAINT_ANY) ) {
  213. unionWildcard.fType = NSCONSTRAINT_ANY;
  214. }
  215. // 3 If both O1 and O2 are sets of (namespace names or absent), then the union of
  216. // those sets must be the value.
  217. else if ( (fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_LIST) ) {
  218. unionWildcard.fType = NSCONSTRAINT_LIST;
  219. unionWildcard.fNamespaceList = union2sets(fNamespaceList, wildcard.fNamespaceList);
  220. }
  221. // -4 If the two are negations of different namespace names, then the intersection
  222. // is not expressible.
  223. // +4 If the two are negations of different namespace names or absent, then
  224. // a pair of not and absent must be the value.
  225. // * now we store ##other as not(list), the result should be
  226. // not(intersection of two lists).
  227. else if (fType == NSCONSTRAINT_NOT && wildcard.fType == NSCONSTRAINT_NOT) {
  228. unionWildcard.fType = NSCONSTRAINT_NOT;
  229. unionWildcard.fNamespaceList = new String[2];
  230. unionWildcard.fNamespaceList[0] = ABSENT;
  231. unionWildcard.fNamespaceList[1] = ABSENT;
  232. }
  233. // 5 If either O1 or O2 is a pair of not and a namespace name and the other is a set of
  234. // (namespace names or absent), then The appropriate case among the following must be true:
  235. // -5.1 If the set includes the negated namespace name, then any must be the value.
  236. // -5.2 If the set does not include the negated namespace name, then whichever of O1 or O2
  237. // is a pair of not and a namespace name must be the value.
  238. // +5.1 If the negated value is a namespace name, then The appropriate case
  239. // among the following must be true:
  240. // +5.1.1 If the set includes both the namespace name and absent, then any
  241. // must be the value.
  242. // +5.1.2 If the set includes the namespace name but does not include
  243. // absent, then a pair of not and absent must be the value.
  244. // +5.1.3 If the set does not include the namespace name but includes
  245. // absent, then the union is not expressible.
  246. // +5.1.4 If the set does not include either the namespace name or absent,
  247. // then whichever of O1 or O2 is a pair of not and a namespace name must be
  248. // the value.
  249. // +5.2 If the negated value is absent, then The appropriate case among the
  250. // following must be true:
  251. // +5.2.1 If the set includes absent, then any must be the value.
  252. // +5.2.2 If the set does not include absent, then whichever of O1 or O2 is
  253. // a pair of not and a namespace name must be the value.
  254. // * when we have not(list), the operation is just not(otherlist-list)
  255. else if ( ((fType == NSCONSTRAINT_NOT) && (wildcard.fType == NSCONSTRAINT_LIST)) ||
  256. ((fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_NOT)) ) {
  257. String[] other = null;
  258. String[] list = null;
  259. if (fType == NSCONSTRAINT_NOT) {
  260. other = fNamespaceList;
  261. list = wildcard.fNamespaceList;
  262. }
  263. else {
  264. other = wildcard.fNamespaceList;
  265. list = fNamespaceList;
  266. }
  267. boolean foundAbsent = elementInSet(ABSENT, list);
  268. if (other[0] != ABSENT) {
  269. boolean foundNS = elementInSet(other[0], list);
  270. if (foundNS && foundAbsent) {
  271. unionWildcard.fType = NSCONSTRAINT_ANY;
  272. } else if (foundNS && !foundAbsent) {
  273. unionWildcard.fType = NSCONSTRAINT_NOT;
  274. unionWildcard.fNamespaceList = new String[2];
  275. unionWildcard.fNamespaceList[0] = ABSENT;
  276. unionWildcard.fNamespaceList[1] = ABSENT;
  277. } else if (!foundNS && foundAbsent) {
  278. return null;
  279. } else { // !foundNS && !foundAbsent
  280. unionWildcard.fType = NSCONSTRAINT_NOT;
  281. unionWildcard.fNamespaceList = other;
  282. }
  283. } else { // other[0] == ABSENT
  284. if (foundAbsent) {
  285. unionWildcard.fType = NSCONSTRAINT_ANY;
  286. } else { // !foundAbsent
  287. unionWildcard.fType = NSCONSTRAINT_NOT;
  288. unionWildcard.fNamespaceList = other;
  289. }
  290. }
  291. }
  292. return unionWildcard;
  293. } // performUnionWith
  294. /**
  295. * Schema Component Constraint: Attribute Wildcard Intersection
  296. */
  297. public XSWildcardDecl performIntersectionWith(XSWildcardDecl wildcard,
  298. short processContents) {
  299. // if the other wildcard is not expressible, the result is still not expressible
  300. if (wildcard == null)
  301. return null;
  302. // For a wildcard's {namespace constraint} value to be the intensional intersection of
  303. // two other such values (call them O1 and O2): the appropriate case among the following
  304. // must be true:
  305. XSWildcardDecl intersectWildcard = new XSWildcardDecl();
  306. intersectWildcard.fProcessContents = processContents;
  307. // 1 If O1 and O2 are the same value, then that value must be the value.
  308. if (areSame(wildcard)) {
  309. intersectWildcard.fType = fType;
  310. intersectWildcard.fNamespaceList = fNamespaceList;
  311. }
  312. // 2 If either O1 or O2 is any, then the other must be the value.
  313. else if ( (fType == NSCONSTRAINT_ANY) || (wildcard.fType == NSCONSTRAINT_ANY) ) {
  314. // both cannot be ANY, if we have reached here.
  315. XSWildcardDecl other = this;
  316. if (fType == NSCONSTRAINT_ANY)
  317. other = wildcard;
  318. intersectWildcard.fType = other.fType;
  319. intersectWildcard.fNamespaceList = other.fNamespaceList;
  320. }
  321. // -3 If either O1 or O2 is a pair of not and a namespace name and the other is a set of
  322. // (namespace names or absent), then that set, minus the negated namespace name if
  323. // it was in the set, must be the value.
  324. // +3 If either O1 or O2 is a pair of not and a namespace name and the other
  325. // is a set of (namespace names or absent), then that set, minus the negated
  326. // namespace name if it was in the set, then minus absent if it was in the
  327. // set, must be the value.
  328. // * when we have not(list), the operation is just list-otherlist
  329. else if ( ((fType == NSCONSTRAINT_NOT) && (wildcard.fType == NSCONSTRAINT_LIST)) ||
  330. ((fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_NOT)) ) {
  331. String[] list = null;
  332. String[] other = null;
  333. if (fType == NSCONSTRAINT_NOT) {
  334. other = fNamespaceList;
  335. list = wildcard.fNamespaceList;
  336. }
  337. else {
  338. other = wildcard.fNamespaceList;
  339. list = fNamespaceList;
  340. }
  341. int listSize = list.length;
  342. String[] intersect = new String[listSize];
  343. int newSize = 0;
  344. for (int i = 0; i < listSize; i++) {
  345. if (list[i] != other[0] && list[i] != ABSENT)
  346. intersect[newSize++] = list[i];
  347. }
  348. intersectWildcard.fType = NSCONSTRAINT_LIST;
  349. intersectWildcard.fNamespaceList = new String[newSize];
  350. System.arraycopy(intersect, 0, intersectWildcard.fNamespaceList, 0, newSize);
  351. }
  352. // 4 If both O1 and O2 are sets of (namespace names or absent), then the intersection of those
  353. // sets must be the value.
  354. else if ( (fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_LIST) ) {
  355. intersectWildcard.fType = NSCONSTRAINT_LIST;
  356. intersectWildcard.fNamespaceList = intersect2sets(fNamespaceList, wildcard.fNamespaceList);
  357. }
  358. // -5 If the two are negations of different namespace names, then the intersection is not expressible.
  359. // +5 If the two are negations of namespace names or absent, then The
  360. // appropriate case among the following must be true:
  361. // +5.1 If the two are negations of different namespace names, then the
  362. // intersection is not expressible.
  363. // +5.2 If one of the two is a pair of not and absent, the other must be
  364. // the value.
  365. // * when we have not(list), the operation is just not(onelist+otherlist)
  366. else if (fType == NSCONSTRAINT_NOT && wildcard.fType == NSCONSTRAINT_NOT) {
  367. if (fNamespaceList[0] != ABSENT && wildcard.fNamespaceList[0] != ABSENT)
  368. return null;
  369. XSWildcardDecl other = this;
  370. if (fNamespaceList[0] == ABSENT)
  371. other = wildcard;
  372. intersectWildcard.fType = other.fType;
  373. intersectWildcard.fNamespaceList = other.fNamespaceList;
  374. }
  375. return intersectWildcard;
  376. } // performIntersectionWith
  377. private boolean areSame(XSWildcardDecl wildcard) {
  378. if (fType == wildcard.fType) {
  379. // ##any, true
  380. if (fType == NSCONSTRAINT_ANY)
  381. return true;
  382. // ##other, only check the negated value
  383. // * when we support not(list), we need to check in the same way
  384. // as for NSCONSTRAINT_LIST.
  385. if (fType == NSCONSTRAINT_NOT)
  386. return fNamespaceList[0] == wildcard.fNamespaceList[0];
  387. // ## list, must have the same length,
  388. // and each item in one list must appear in the other one
  389. // (we are assuming that there are no duplicate items in a list)
  390. if (fNamespaceList.length == wildcard.fNamespaceList.length) {
  391. for (int i=0; i<fNamespaceList.length; i++) {
  392. if (!elementInSet(fNamespaceList[i], wildcard.fNamespaceList))
  393. return false;
  394. }
  395. return true;
  396. }
  397. }
  398. return false;
  399. } // areSame
  400. String[] intersect2sets(String[] one, String[] theOther){
  401. String[] result = new String[Math.min(one.length,theOther.length)];
  402. // simple implemention,
  403. int count = 0;
  404. for (int i=0; i<one.length; i++) {
  405. if (elementInSet(one[i], theOther))
  406. result[count++] = one[i];
  407. }
  408. String[] result2 = new String[count];
  409. System.arraycopy(result, 0, result2, 0, count);
  410. return result2;
  411. }
  412. String[] union2sets(String[] one, String[] theOther){
  413. String[] result1 = new String[one.length];
  414. // simple implemention,
  415. int count = 0;
  416. for (int i=0; i<one.length; i++) {
  417. if (!elementInSet(one[i], theOther))
  418. result1[count++] = one[i];
  419. }
  420. String[] result2 = new String[count+theOther.length];
  421. System.arraycopy(result1, 0, result2, 0, count);
  422. System.arraycopy(theOther, 0, result2, count, theOther.length);
  423. return result2;
  424. }
  425. boolean subset2sets(String[] subSet, String[] superSet){
  426. for (int i=0; i<subSet.length; i++) {
  427. if (!elementInSet(subSet[i], superSet))
  428. return false;
  429. }
  430. return true;
  431. }
  432. boolean elementInSet(String ele, String[] set){
  433. boolean found = false;
  434. for (int i=0; i<set.length && !found; i++) {
  435. if (ele==set[i])
  436. found = true;
  437. }
  438. return found;
  439. }
  440. /**
  441. * get the string description of this wildcard
  442. */
  443. private String fDescription = null;
  444. public String toString() {
  445. if (fDescription == null) {
  446. StringBuffer buffer = new StringBuffer();
  447. buffer.append("WC[");
  448. switch (fType) {
  449. case NSCONSTRAINT_ANY:
  450. buffer.append(SchemaSymbols.ATTVAL_TWOPOUNDANY);
  451. break;
  452. case NSCONSTRAINT_NOT:
  453. buffer.append(SchemaSymbols.ATTVAL_TWOPOUNDOTHER);
  454. buffer.append(":\"");
  455. if (fNamespaceList[0] != null)
  456. buffer.append(fNamespaceList[0]);
  457. buffer.append("\"");
  458. break;
  459. case NSCONSTRAINT_LIST:
  460. if (fNamespaceList.length == 0)
  461. break;
  462. buffer.append("\"");
  463. if (fNamespaceList[0] != null)
  464. buffer.append(fNamespaceList[0]);
  465. buffer.append("\"");
  466. for (int i = 1; i < fNamespaceList.length; i++) {
  467. buffer.append(",\"");
  468. if (fNamespaceList[i] != null)
  469. buffer.append(fNamespaceList[i]);
  470. buffer.append("\"");
  471. }
  472. break;
  473. }
  474. buffer.append("]");
  475. fDescription = buffer.toString();
  476. }
  477. return fDescription;
  478. }
  479. /**
  480. * Get the type of the object, i.e ELEMENT_DECLARATION.
  481. */
  482. public short getType() {
  483. return XSConstants.WILDCARD;
  484. }
  485. /**
  486. * The <code>name</code> of this <code>XSObject</code> depending on the
  487. * <code>XSObject</code> type.
  488. */
  489. public String getName() {
  490. return null;
  491. }
  492. /**
  493. * The namespace URI of this node, or <code>null</code> if it is
  494. * unspecified. defines how a namespace URI is attached to schema
  495. * components.
  496. */
  497. public String getNamespace() {
  498. return null;
  499. }
  500. /**
  501. * Namespace constraint: A constraint type: any, not, list.
  502. */
  503. public short getConstraintType() {
  504. return fType;
  505. }
  506. /**
  507. * Namespace constraint. For <code>constraintType</code>
  508. * LIST_NSCONSTRAINT, the list contains allowed namespaces. For
  509. * <code>constraintType</code> NOT_NSCONSTRAINT, the list contains
  510. * disallowed namespaces.
  511. */
  512. public StringList getNsConstraintList() {
  513. return new StringListImpl(fNamespaceList, fNamespaceList == null ? 0 : fNamespaceList.length);
  514. }
  515. /**
  516. * {process contents} One of skip, lax or strict. Valid constants values
  517. * are: PC_SKIP, PC_LAX, PC_STRICT.
  518. */
  519. public short getProcessContents() {
  520. return fProcessContents;
  521. }
  522. /**
  523. * String valid of {process contents}. One of "skip", "lax" or "strict".
  524. */
  525. public String getProcessContentsAsString() {
  526. switch (fProcessContents) {
  527. case XSWildcardDecl.PC_SKIP: return "skip";
  528. case XSWildcardDecl.PC_LAX: return "lax";
  529. case XSWildcardDecl.PC_STRICT: return "strict";
  530. default: return "invalid value";
  531. }
  532. }
  533. /**
  534. * Optional. Annotation.
  535. */
  536. public XSAnnotation getAnnotation() {
  537. return fAnnotation;
  538. }
  539. /**
  540. * @see com.sun.org.apache.xerces.internal.xs.XSObject#getNamespaceItem()
  541. */
  542. public XSNamespaceItem getNamespaceItem() {
  543. // REVISIT: implement
  544. return null;
  545. }
  546. } // class XSWildcardDecl