286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 1999-2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A/*
286N/A * $Id: NSInfo.java,v 1.2.4.1 2005/09/15 08:15:48 suresh_emailid Exp $
286N/A */
286N/Apackage com.sun.org.apache.xml.internal.utils;
286N/A
286N/A/**
286N/A * This class holds information about the namespace info
286N/A * of a node. It is used to optimize namespace lookup in
286N/A * a generic DOM.
286N/A * @xsl.usage internal
286N/A */
286N/Apublic class NSInfo
286N/A{
286N/A
286N/A /**
286N/A * Constructor NSInfo
286N/A *
286N/A *
286N/A * @param hasProcessedNS Flag indicating whether namespaces
286N/A * have been processed for this node
286N/A * @param hasXMLNSAttrs Flag indicating whether this node
286N/A * has XMLNS attributes.
286N/A */
286N/A public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs)
286N/A {
286N/A
286N/A m_hasProcessedNS = hasProcessedNS;
286N/A m_hasXMLNSAttrs = hasXMLNSAttrs;
286N/A m_namespace = null;
286N/A m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
286N/A }
286N/A
286N/A // Unused at the moment
286N/A
286N/A /**
286N/A * Constructor NSInfo
286N/A *
286N/A *
286N/A * @param hasProcessedNS Flag indicating whether namespaces
286N/A * have been processed for this node
286N/A * @param hasXMLNSAttrs Flag indicating whether this node
286N/A * has XMLNS attributes.
286N/A * @param ancestorHasXMLNSAttrs Flag indicating whether one of this node's
286N/A * ancestor has XMLNS attributes.
286N/A */
286N/A public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs,
286N/A int ancestorHasXMLNSAttrs)
286N/A {
286N/A
286N/A m_hasProcessedNS = hasProcessedNS;
286N/A m_hasXMLNSAttrs = hasXMLNSAttrs;
286N/A m_ancestorHasXMLNSAttrs = ancestorHasXMLNSAttrs;
286N/A m_namespace = null;
286N/A }
286N/A
286N/A /**
286N/A * Constructor NSInfo
286N/A *
286N/A *
286N/A * @param namespace The namespace URI
286N/A * @param hasXMLNSAttrs Flag indicating whether this node
286N/A * has XMLNS attributes.
286N/A */
286N/A public NSInfo(String namespace, boolean hasXMLNSAttrs)
286N/A {
286N/A
286N/A m_hasProcessedNS = true;
286N/A m_hasXMLNSAttrs = hasXMLNSAttrs;
286N/A m_namespace = namespace;
286N/A m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
286N/A }
286N/A
286N/A /** The namespace URI */
286N/A public String m_namespace;
286N/A
286N/A /** Flag indicating whether this node has an XMLNS attribute */
286N/A public boolean m_hasXMLNSAttrs;
286N/A
286N/A /** Flag indicating whether namespaces have been processed for this node */
286N/A public boolean m_hasProcessedNS;
286N/A
286N/A /** Flag indicating whether one of this node's ancestor has an XMLNS attribute */
286N/A public int m_ancestorHasXMLNSAttrs;
286N/A
286N/A /** Constant for ancestors XMLNS atributes not processed */
286N/A public static final int ANCESTORXMLNSUNPROCESSED = 0;
286N/A
286N/A /** Constant indicating an ancestor has an XMLNS attribute */
286N/A public static final int ANCESTORHASXMLNS = 1;
286N/A
286N/A /** Constant indicating ancestors don't have an XMLNS attribute */
286N/A public static final int ANCESTORNOXMLNS = 2;
286N/A}