286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 1999-2002,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/Apackage com.sun.org.apache.xerces.internal.dom;
286N/A
286N/A/**
286N/A * Processing Instructions (PIs) permit documents to carry
286N/A * processor-specific information alongside their actual content. PIs
286N/A * are most common in XML, but they are supported in HTML as well.
286N/A *
286N/A * @xerces.internal
286N/A *
286N/A * @since PR-DOM-Level-1-19980818.
286N/A */
286N/Apublic class DeferredProcessingInstructionImpl
286N/A extends ProcessingInstructionImpl
286N/A implements DeferredNode {
286N/A
286N/A //
286N/A // Constants
286N/A //
286N/A
286N/A /** Serialization version. */
286N/A static final long serialVersionUID = -4643577954293565388L;
286N/A
286N/A //
286N/A // Data
286N/A //
286N/A
286N/A /** Node index. */
286N/A protected transient int fNodeIndex;
286N/A
286N/A //
286N/A // Constructors
286N/A //
286N/A
286N/A /**
286N/A * This is the deferred constructor. Only the fNodeIndex is given here.
286N/A * All other data, can be requested from the ownerDocument via the index.
286N/A */
286N/A DeferredProcessingInstructionImpl(DeferredDocumentImpl ownerDocument,
286N/A int nodeIndex) {
286N/A super(ownerDocument, null, null);
286N/A
286N/A fNodeIndex = nodeIndex;
286N/A needsSyncData(true);
286N/A
286N/A } // <init>(DeferredDocumentImpl,int)
286N/A
286N/A //
286N/A // DeferredNode methods
286N/A //
286N/A
286N/A /** Returns the node index. */
286N/A public int getNodeIndex() {
286N/A return fNodeIndex;
286N/A }
286N/A
286N/A //
286N/A // Protected methods
286N/A //
286N/A
286N/A /** Synchronizes the data. */
286N/A protected void synchronizeData() {
286N/A
286N/A // no need to sync in the future
286N/A needsSyncData(false);
286N/A
286N/A // fluff data
286N/A DeferredDocumentImpl ownerDocument =
286N/A (DeferredDocumentImpl) this.ownerDocument();
286N/A target = ownerDocument.getNodeName(fNodeIndex);
286N/A data = ownerDocument.getNodeValueString(fNodeIndex);
286N/A
286N/A } // synchronizeData()
286N/A
286N/A} // class DeferredProcessingInstructionImpl