1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Nov 2017
4 */
5 /*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 package com.sun.org.apache.xerces.internal.impl.xs;
23
29 import com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder;
30 import com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator;
31 import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
32 import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
33 import com.sun.org.apache.xerces.internal.util.SymbolHash;
34 import com.sun.org.apache.xerces.internal.xs.XSConstants;
35 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
36 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
37 import java.util.ArrayList;
38 import java.util.Collections;
39 import java.util.Comparator;
40 import java.util.List;
41
42 /**
43 * Constaints shared by traversers and validator
44 *
45 * @xerces.internal
46 *
47 * @author Sandy Gao, IBM
48 *
49 */
50 public class XSConstraints {
51
52 // IHR: Visited on 2006-11-17
53 // Added a boolean return value to particleValidRestriction (it was a void function)
54 // to help the checkRecurseLax to know when expansion has happened and no order is required
55 // (IHR@xbrl.org) (Ignacio@Hernandez-Ros.com)
56
57 static final int OCCURRENCE_UNKNOWN = SchemaSymbols.OCCURRENCE_UNBOUNDED-1;
58 static final XSSimpleType STRING_TYPE =
59 (XSSimpleType)SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_STRING);
60
61 private static XSParticleDecl fEmptyParticle = null;
62 public static XSParticleDecl getEmptySequence() {
63 if (fEmptyParticle == null) {
64 XSModelGroupImpl group = new XSModelGroupImpl();
65 group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
66 group.fParticleCount = 0;
67 group.fParticles = null;
68 group.fAnnotations = XSObjectListImpl.EMPTY_LIST;
|
1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 */
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements. See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package com.sun.org.apache.xerces.internal.impl.xs;
22
28 import com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder;
29 import com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator;
30 import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
31 import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
32 import com.sun.org.apache.xerces.internal.util.SymbolHash;
33 import com.sun.org.apache.xerces.internal.xs.XSConstants;
34 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
35 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
36 import java.util.ArrayList;
37 import java.util.Collections;
38 import java.util.Comparator;
39 import java.util.List;
40
41 /**
42 * Constaints shared by traversers and validator
43 *
44 * @xerces.internal
45 *
46 * @author Sandy Gao, IBM
47 *
48 * @LastModified: Nov 2017
49 */
50 public class XSConstraints {
51
52 // IHR: Visited on 2006-11-17
53 // Added a boolean return value to particleValidRestriction (it was a void function)
54 // to help the checkRecurseLax to know when expansion has happened and no order is required
55 // (IHR@xbrl.org) (Ignacio@Hernandez-Ros.com)
56
57 static final int OCCURRENCE_UNKNOWN = SchemaSymbols.OCCURRENCE_UNBOUNDED-1;
58 static final XSSimpleType STRING_TYPE =
59 (XSSimpleType)SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_STRING);
60
61 private static XSParticleDecl fEmptyParticle = null;
62 public static XSParticleDecl getEmptySequence() {
63 if (fEmptyParticle == null) {
64 XSModelGroupImpl group = new XSModelGroupImpl();
65 group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
66 group.fParticleCount = 0;
67 group.fParticles = null;
68 group.fAnnotations = XSObjectListImpl.EMPTY_LIST;
|