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 22package com.sun.org.apache.xerces.internal.xs; 23 24/** 25 * Describes a constraining facet. Enumeration and pattern facets are exposed 26 * via <code>XSMultiValueFacet</code> interface. 27 */ 28public interface XSFacet extends XSObject { 29 /** 30 * The name of the facet, e.g. <code>FACET_LENGTH, FACET_TOTALDIGITS</code> 31 * (see <code>XSSimpleTypeDefinition</code>). 32 */ 33 public short getFacetKind(); 34 35 /** 36 * A value of this facet. 37 */ 38 public String getLexicalFacetValue(); 39 40 /** 41 * If this facet is length, minLength, maxLength, totalDigits, or 42 * fractionDigits, and if the value can fit in "int", then return the value 43 * of the facet as an int. If the value can't fit, return -1. Use 44 * getActualFacetValue() to get the BigInteger representation. For all other 45 * facets, return 0. 46 */ 47 public int getIntFacetValue(); 48 49 /** 50 * If this facet is minInclusive, maxInclusive, minExclusive, or 51 * maxExclusive, then return the actual value of the facet. If this facet 52 * is length, minLength, maxLength, totalDigits, or fractionDigits, then 53 * return a BigInteger representation of the value. If this facet is 54 * whiteSpace, then return the String representation of the facet. 55 */ 56 public Object getActualFacetValue(); 57 58 /** 59 * [Facets]: check whether a facet is fixed. 60 */ 61 public boolean getFixed(); 62 63 /** 64 * An annotation if it exists, otherwise <code>null</code>. If not null 65 * then the first [annotation] from the sequence of annotations. 66 */ 67 public XSAnnotation getAnnotation(); 68 69 /** 70 * A sequence of [annotations] or an empty <code>XSObjectList</code>. 71 */ 72 public XSObjectList getAnnotations(); 73} 74