src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java

Print this page


   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright 2005 The Apache Software Foundation.
   7  *
   8  * Licensed under the Apache License, Version 2.0 (the "License");
   9  * you may not use this file except in compliance with the License.
  10  * 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 package com.sun.org.apache.xerces.internal.xpointer;
  21 
  22 import com.sun.org.apache.xerces.internal.impl.Constants;
  23 import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
  24 import com.sun.org.apache.xerces.internal.util.SymbolTable;
  25 import com.sun.org.apache.xerces.internal.xni.Augmentations;
  26 import com.sun.org.apache.xerces.internal.xni.QName;
  27 import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
  28 import com.sun.org.apache.xerces.internal.xni.XNIException;
  29 import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
  30 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
  31 
  32 /**
  33  * <p>
  34  * Implements the XPointerPart interface and handles processing of
  35  * ShortHand Pointers.  It identifies at most one element in the
  36  * resource's information set; specifically, the first one (if any)
  37  * in document order that has a matching NCName as an identifier.
  38  * </p>
  39  *
  40  *
  41  */
  42 class ShortHandPointer implements XPointerPart {
  43 
  44     // The name of the ShortHand pointer
  45     private String fShortHandPointer;
  46 
  47     // The name of the ShortHand pointer
  48     private boolean fIsFragmentResolved = false;
  49 
  50     // SymbolTable
  51     private SymbolTable fSymbolTable;
  52 
  53     //
  54     // Constructors
  55     //
  56     public ShortHandPointer() {
  57     }
  58 
  59     public ShortHandPointer(SymbolTable symbolTable) {
  60         fSymbolTable = symbolTable;
  61     }
  62 


 244      * @throws XNIException
 245      */
 246     public String getChildrenSchemaDeterminedID(XMLAttributes attributes,
 247             int index) throws XNIException {
 248         return null;
 249     }
 250 
 251     /**
 252      *
 253      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isFragmentResolved()
 254      */
 255     public boolean isFragmentResolved() {
 256         return fIsFragmentResolved;
 257     }
 258 
 259     /**
 260      *
 261      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isChildFragmentResolved()
 262      */
 263     public boolean isChildFragmentResolved() {
 264         return fIsFragmentResolved & ( fMatchingChildCount >  0);
 265     }
 266 
 267     /**
 268      * Returns the name of the ShortHand pointer
 269      *
 270      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#getSchemeName()
 271      */
 272     public String getSchemeName() {
 273         return fShortHandPointer;
 274     }
 275 
 276     /**
 277      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#getSchemeData()
 278      */
 279     public String getSchemeData() {
 280         return null;
 281     }
 282 
 283     /**
 284      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#setSchemeName(java.lang.String)
   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   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.xpointer;
  23 
  24 import com.sun.org.apache.xerces.internal.impl.Constants;
  25 import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
  26 import com.sun.org.apache.xerces.internal.util.SymbolTable;
  27 import com.sun.org.apache.xerces.internal.xni.Augmentations;
  28 import com.sun.org.apache.xerces.internal.xni.QName;
  29 import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
  30 import com.sun.org.apache.xerces.internal.xni.XNIException;
  31 import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
  32 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
  33 
  34 /**
  35  * <p>
  36  * Implements the XPointerPart interface and handles processing of
  37  * ShortHand Pointers.  It identifies at most one element in the
  38  * resource's information set; specifically, the first one (if any)
  39  * in document order that has a matching NCName as an identifier.
  40  * </p>
  41  *

  42  */
  43 final class ShortHandPointer implements XPointerPart {
  44 
  45     // The name of the ShortHand pointer
  46     private String fShortHandPointer;
  47 
  48     // The name of the ShortHand pointer
  49     private boolean fIsFragmentResolved = false;
  50 
  51     // SymbolTable
  52     private SymbolTable fSymbolTable;
  53 
  54     //
  55     // Constructors
  56     //
  57     public ShortHandPointer() {
  58     }
  59 
  60     public ShortHandPointer(SymbolTable symbolTable) {
  61         fSymbolTable = symbolTable;
  62     }
  63 


 245      * @throws XNIException
 246      */
 247     public String getChildrenSchemaDeterminedID(XMLAttributes attributes,
 248             int index) throws XNIException {
 249         return null;
 250     }
 251 
 252     /**
 253      *
 254      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isFragmentResolved()
 255      */
 256     public boolean isFragmentResolved() {
 257         return fIsFragmentResolved;
 258     }
 259 
 260     /**
 261      *
 262      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isChildFragmentResolved()
 263      */
 264     public boolean isChildFragmentResolved() {
 265         return fIsFragmentResolved && ( fMatchingChildCount >  0);
 266     }
 267 
 268     /**
 269      * Returns the name of the ShortHand pointer
 270      *
 271      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#getSchemeName()
 272      */
 273     public String getSchemeName() {
 274         return fShortHandPointer;
 275     }
 276 
 277     /**
 278      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#getSchemeData()
 279      */
 280     public String getSchemeData() {
 281         return null;
 282     }
 283 
 284     /**
 285      * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#setSchemeName(java.lang.String)