001 // Copyright 2004, 2005 The Apache Software Foundation
002 //
003 // Licensed under the Apache License, Version 2.0 (the "License");
004 // you may not use this file except in compliance with the License.
005 // You may obtain a copy of the License at
006 //
007 // http://www.apache.org/licenses/LICENSE-2.0
008 //
009 // Unless required by applicable law or agreed to in writing, software
010 // distributed under the License is distributed on an "AS IS" BASIS,
011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 // See the License for the specific language governing permissions and
013 // limitations under the License.
014
015 package org.apache.hivemind.schema;
016
017 import org.apache.hivemind.Locatable;
018 import org.apache.hivemind.parse.AnnotationHolder;
019
020
021 /**
022 * Part of a {@link Schema}, used to specify an attribute allowed within
023 * an {@link org.apache.hivemind.schema.ElementModel}.
024 *
025 * @author Howard Lewis Ship
026 */
027 public interface AttributeModel extends Locatable, AnnotationHolder
028 {
029 /**
030 * The name of the attribute.
031 */
032 public String getName();
033
034 /**
035 * Returns true if the attribute is required (must be specified). Otherwise,
036 * the attribute is optional and may be omitted.
037 */
038 public boolean isRequired();
039
040 /**
041 * Returns the translator used to convert the attribute value. This is used
042 * to locate a {@link org.apache.hivemind.schema.Translator}.
043 */
044 public String getTranslator();
045
046 /**
047 * Returns true if the attribute is supposed to be considered unique in relation to the configuration point.
048 * @return True if the attribute must be unique with respect to it's xpath, otherwise false
049 */
050 public boolean isUnique();
051
052 }