KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > dtd > schema > Attribute


1 /*******************************************************************************
2  * Copyright (c) 2002, 2005 Object Factory Inc.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * Object Factory Inc. - Initial implementation
10  *******************************************************************************/

11 package org.eclipse.ant.internal.ui.dtd.schema;
12
13 import org.eclipse.ant.internal.ui.dtd.*;
14
15 /**
16  * Attr contains information about a single attribute.
17  * @author Bob Foster
18  */

19 public class Attribute extends Atom implements IAttribute {
20     private String JavaDoc fType;
21     private String JavaDoc[] fEnum;
22     private IElement fElement;
23     private String JavaDoc fDefault;
24     private boolean fFixed;
25     private boolean fRequired;
26     
27     /**
28      * Constructor.
29      * @param name Attribute qname.
30      * @param element Parent element.
31      */

32     public Attribute(String JavaDoc name, IElement element) {
33         super(ATTRIBUTE, name);
34         fElement = element;
35     }
36
37     /* (non-Javadoc)
38      * @see org.eclipse.ant.internal.ui.dtd.IAttribute#getType()
39      */

40     public String JavaDoc getType() {
41         return fType;
42     }
43     
44     /* (non-Javadoc)
45      * @see org.eclipse.ant.internal.ui.dtd.IAttribute#getEnum()
46      */

47     public String JavaDoc[] getEnum() {
48         return fEnum;
49     }
50     
51     /* (non-Javadoc)
52      * @see org.eclipse.ant.internal.ui.dtd.IAttribute#getElement()
53      */

54     public IElement getElement() {
55         return fElement;
56     }
57     
58     /* (non-Javadoc)
59      * @see org.eclipse.ant.internal.ui.dtd.IAttribute#getDefault()
60      */

61     public String JavaDoc getDefault() {
62         return fDefault;
63     }
64     
65     /* (non-Javadoc)
66      * @see org.eclipse.ant.internal.ui.dtd.IAttribute#isFixed()
67      */

68     public boolean isFixed() {
69         return fFixed;
70     }
71     
72     /* (non-Javadoc)
73      * @see org.eclipse.ant.internal.ui.dtd.IAttribute#isRequired()
74      */

75     public boolean isRequired() {
76         return fRequired;
77     }
78     
79     public void setType(String JavaDoc type) {
80         fType = type;
81     }
82     
83     /**
84      * Sets the default value.
85      * @param defaultValue Value
86      */

87     public void setDefault(String JavaDoc defaultValue) {
88         fDefault = defaultValue;
89     }
90
91     /**
92      * Sets the enumeration.
93      * @param enumeration The enumeration to set
94      */

95     public void setEnum(String JavaDoc[] enumeration) {
96         fEnum = enumeration;
97     }
98
99     /**
100      * Sets the fixed.
101      * @param fixed The fixed to set
102      */

103     public void setFixed(boolean fixed) {
104         fFixed = fixed;
105     }
106
107     /**
108      * Sets the required.
109      * @param required The required to set
110      */

111     public void setRequired(boolean required) {
112         fRequired = required;
113     }
114 }
115
Popular Tags