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.xs;
  23 
  24 /**
  25  * The interface represents the Attribute Declaration schema component.
  26  */
  27 public interface XSAttributeDeclaration extends XSObject {
  28     /**
  29      * [type definition]: A simple type definition.
  30      */
  31     public XSSimpleTypeDefinition getTypeDefinition();
  32 
  33     /**
  34      * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or
  35      * <code>SCOPE_ABSENT</code>. If the scope is local, then the
  36      * <code>enclosingCTDefinition</code> is present.
  37      */
  38     public short getScope();
  39 
  40     /**
  41      * The complex type definition for locally scoped declarations (see
  42      * <code>scope</code>), otherwise <code>null</code> if no such
  43      * definition exists.
  44      */
  45     public XSComplexTypeDefinition getEnclosingCTDefinition();
  46 
  47     /**
  48      * Value constraint: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
  49      */
  50     public short getConstraintType();
  51 
  52     /**
  53      * Value constraint: The constraint value with respect to the [type
  54      * definition], otherwise <code>null</code>.
  55      *
  56      * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
  57      */
  58     public String getConstraintValue();
  59 
  60     /**
  61      * Value Constraint: Binding specific actual constraint value or
  62      * <code>null</code> if the value is in error or there is no value
  63      * constraint.
  64      * @exception XSException
  65      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
  66      *   method.
  67      *
  68      *  @deprecated Use getValueConstraintValue().getActualValue() instead
  69      */
  70     public Object getActualVC()
  71                                                         throws XSException;
  72 
  73     /**
  74      * The actual constraint value built-in datatype, e.g.
  75      * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
  76      * value is a list type definition, this method returns
  77      * <code>LIST_DT</code>. If the type definition of this value is a list
  78      * type definition whose item type is a union type definition, this
  79      * method returns <code>LISTOFUNION_DT</code>. To query the actual
  80      * constraint value of the list or list of union type definitions use
  81      * <code>itemValueTypes</code>. If the <code>actualValue</code> is
  82      * <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>.
  83      * @exception XSException
  84      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
  85      *   method.
  86      *
  87      *  @deprecated Use getValueConstraintValue().getActualValueType() instead
  88      */
  89     public short getActualVCType()
  90                                                         throws XSException;
  91 
  92     /**
  93      * In the case the actual constraint value represents a list, i.e. the
  94      * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
  95      * array consists of one type kind which represents the itemType. If the
  96      * actual constraint value represents a list type definition whose item
  97      * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
  98      * for each actual constraint value in the list the array contains the
  99      * corresponding memberType kind. For examples, see
 100      * <code>ItemPSVI.itemValueTypes</code>.
 101      * @exception XSException
 102      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
 103      *   method.
 104      *
 105      *  @deprecated Use getValueConstraintValue().getListValueTypes() instead
 106      */
 107     public ShortList getItemValueTypes()
 108                                                         throws XSException;
 109 
 110     /**
 111      * The actual value of the default or fixed value constraint.
 112      */
 113     public XSValue getValueConstraintValue();
 114 
 115     /**
 116      * An annotation if it exists, otherwise <code>null</code>.
 117      * If not null then the first [annotation] from the sequence of annotations.
 118      */
 119     public XSAnnotation getAnnotation();
 120 
 121     /**
 122      * A sequence of [annotations] or an empty  <code>XSObjectList</code>.
 123      */
 124     public XSObjectList getAnnotations();
 125 }