KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ca > directory > jxplorer > viewer > tableviewer > AttributeType


1 package com.ca.directory.jxplorer.viewer.tableviewer;
2
3 /**
4  * TableAttributeEditor utility class; encapsulates the idea of
5  * a displayable object type name, that may or may not be mandatory
6  * (and hence displayed differently).
7  */

8  
9 public class AttributeType
10 {
11     static final int NORMAL = 0;
12     static final int MANDATORY = 1; // whether attribute is required
13
static final int BINARY = 2; // future use
14

15
16     public String JavaDoc value;
17     public boolean mandatory;
18     
19     
20     /**
21      * initialise with an object, take a backup, and set changed to false
22      */

23     public AttributeType(String JavaDoc name, boolean isMandatory)
24     {
25         // trim ";binary" for display purposes... (Is this what people want I wonder?)
26
if (name.endsWith(";binary"))
27             name = name.substring(0, name.length()-7);
28
29         value = name;
30         mandatory = isMandatory;
31     }
32     
33     public String JavaDoc getValue() { return value; }
34     
35     public boolean isMandatory() { return mandatory; }
36
37     public String JavaDoc toString() { return value; }
38     
39 }
Popular Tags