< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/MultipleScopeNamespaceSupport.java

Print this page


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Oct 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.xinclude;
  23 
  24 import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
  25 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
  26 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
  27 import java.util.Enumeration;
  28 
  29 /**
  30  * This implementation of NamespaceContext has the ability to maintain multiple
  31  * scopes of namespace/prefix bindings.  This is useful in situations when it is
  32  * not always appropriate for elements to inherit the namespace bindings of their
  33  * ancestors (such as included elements in XInclude).
  34  *
  35  * When searching for a URI to match a prefix, or a prefix to match a URI, it is
  36  * searched for in the current context, then the ancestors of the current context,
  37  * up to the beginning of the current scope.  Other scopes are not searched.
  38  *
  39  * @author Peter McCracken, IBM
  40  *

  41  */
  42 public class MultipleScopeNamespaceSupport extends NamespaceSupport {
  43 
  44     protected int[] fScope = new int[8];
  45     protected int fCurrentScope;
  46 
  47     /**
  48      *
  49      */
  50     public MultipleScopeNamespaceSupport() {
  51         super();
  52         fCurrentScope = 0;
  53         fScope[0] = 0;
  54     }
  55 
  56     /**
  57      * @param context
  58      */
  59     public MultipleScopeNamespaceSupport(NamespaceContext context) {
  60         super(context);


   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.xinclude;
  22 
  23 import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
  24 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
  25 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
  26 import java.util.Enumeration;
  27 
  28 /**
  29  * This implementation of NamespaceContext has the ability to maintain multiple
  30  * scopes of namespace/prefix bindings.  This is useful in situations when it is
  31  * not always appropriate for elements to inherit the namespace bindings of their
  32  * ancestors (such as included elements in XInclude).
  33  *
  34  * When searching for a URI to match a prefix, or a prefix to match a URI, it is
  35  * searched for in the current context, then the ancestors of the current context,
  36  * up to the beginning of the current scope.  Other scopes are not searched.
  37  *
  38  * @author Peter McCracken, IBM
  39  *
  40  * @LastModified: Oct 2017
  41  */
  42 public class MultipleScopeNamespaceSupport extends NamespaceSupport {
  43 
  44     protected int[] fScope = new int[8];
  45     protected int fCurrentScope;
  46 
  47     /**
  48      *
  49      */
  50     public MultipleScopeNamespaceSupport() {
  51         super();
  52         fCurrentScope = 0;
  53         fScope[0] = 0;
  54     }
  55 
  56     /**
  57      * @param context
  58      */
  59     public MultipleScopeNamespaceSupport(NamespaceContext context) {
  60         super(context);


< prev index next >