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  * This interface represents the Attribute Use schema component.
  26  */
  27 public interface XSAttributeUse extends XSObject {
  28     /**
  29      * [required]: determines whether this use of an attribute declaration
  30      * requires an appropriate attribute information item to be present, or
  31      * merely allows it.
  32      */
  33     public boolean getRequired();
  34 
  35     /**
  36      * [attribute declaration]: provides the attribute declaration itself,
  37      * which will in turn determine the simple type definition used.
  38      */
  39     public XSAttributeDeclaration getAttrDeclaration();
  40 
  41     /**
  42      * Value Constraint: one of default, fixed, or none.
  43      */
  44     public short getConstraintType();
  45 
  46     /**
  47      * Value Constraint: The constraint value, otherwise <code>null</code>.
  48      *
  49      * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
  50      */
  51     public String getConstraintValue();
  52 
  53     /**
  54      * Value Constraint: Binding specific actual constraint value or
  55      * <code>null</code> if the value is in error or there is no value
  56      * constraint.
  57      * @exception XSException
  58      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
  59      *   method.
  60      *
  61      * @deprecated Use getValueConstraintValue().getActualValue() instead
  62      */
  63     public Object getActualVC()
  64                                        throws XSException;
  65 
  66     /**
  67      * The actual constraint value built-in datatype, e.g.
  68      * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
  69      * value is a list type definition, this method returns
  70      * <code>LIST_DT</code>. If the type definition of this value is a list
  71      * type definition whose item type is a union type definition, this
  72      * method returns <code>LISTOFUNION_DT</code>. To query the actual
  73      * constraint value of the list or list of union type definitions use
  74      * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
  75      *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>.
  76      * @exception XSException
  77      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
  78      *   method.
  79      *
  80      * @deprecated Use getValueConstraintValue().getActualValueType() instead
  81      */
  82     public short getActualVCType()
  83                                        throws XSException;
  84 
  85     /**
  86      * In the case the actual constraint value represents a list, i.e. the
  87      * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
  88      * array consists of one type kind which represents the itemType. If the
  89      * actual constraint value represents a list type definition whose item
  90      * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
  91      * for each actual constraint value in the list the array contains the
  92      * corresponding memberType kind. For examples, see
  93      * <code>ItemPSVI.itemValueTypes</code>.
  94      * @exception XSException
  95      *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
  96      *   method.
  97      *
  98      * @deprecated Use getValueConstraintValue().getListValueTypes() instead
  99      */
 100     public ShortList getItemValueTypes()
 101                                        throws XSException;
 102 
 103     /**
 104      * The actual value of the default or fixed value constraint.
 105      */
 106     public XSValue getValueConstraintValue();
 107 
 108     /**
 109      * A sequence of [annotations] or an empty <code>XSObjectList</code>.
 110      */
 111     public XSObjectList getAnnotations();
 112 }