1 /*
2 * Copyright (c) 2015, 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
24 import com.sun.org.apache.xerces.internal.xni.QName;
25 import com.sun.org.apache.xerces.internal.xs.XSConstants;
26 import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
27 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
28 import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
29 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
30 import java.util.ArrayList;
31 import java.util.HashMap;
32 import java.util.List;
33 import java.util.Map;
34
35 /**
36 * To store and validate information about substitutionGroup
37 *
38 * @xerces.internal
39 *
40 * @author Sandy Gao, IBM
41 *
42 */
43 public class SubstitutionGroupHandler {
44
45 private static final XSElementDecl[] EMPTY_GROUP = new XSElementDecl[0];
46
47 // global element declaration resolver
48 private final XSElementDeclHelper fXSElementDeclHelper;
49
50 /**
51 * Default constructor
52 */
53 public SubstitutionGroupHandler(XSElementDeclHelper elementDeclHelper) {
54 fXSElementDeclHelper = elementDeclHelper;
55 }
56
57 // 3.9.4 Element Sequence Locally Valid (Particle) 2.3.3
58 // check whether one element decl matches an element with the given qname
59 public XSElementDecl getMatchingElemDecl(QName element, XSElementDecl exemplar) {
60 if (element.localpart == exemplar.fName &&
61 element.uri == exemplar.fTargetNamespace) {
|
1 /*
2 * Copyright (c) 2015, 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
23 import com.sun.org.apache.xerces.internal.xni.QName;
24 import com.sun.org.apache.xerces.internal.xs.XSConstants;
25 import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
26 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
27 import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
28 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
29 import java.util.ArrayList;
30 import java.util.HashMap;
31 import java.util.List;
32 import java.util.Map;
33
34 /**
35 * To store and validate information about substitutionGroup
36 *
37 * @xerces.internal
38 *
39 * @author Sandy Gao, IBM
40 *
41 * @LastModified: Nov 2017
42 */
43 public class SubstitutionGroupHandler {
44
45 private static final XSElementDecl[] EMPTY_GROUP = new XSElementDecl[0];
46
47 // global element declaration resolver
48 private final XSElementDeclHelper fXSElementDeclHelper;
49
50 /**
51 * Default constructor
52 */
53 public SubstitutionGroupHandler(XSElementDeclHelper elementDeclHelper) {
54 fXSElementDeclHelper = elementDeclHelper;
55 }
56
57 // 3.9.4 Element Sequence Locally Valid (Particle) 2.3.3
58 // check whether one element decl matches an element with the given qname
59 public XSElementDecl getMatchingElemDecl(QName element, XSElementDecl exemplar) {
60 if (element.localpart == exemplar.fName &&
61 element.uri == exemplar.fTargetNamespace) {
|