KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > inheritance > FieldMetaData


1 /* ************************************************************************** *
2  * Copyright (C) 2004 NightLabs GmbH, Marco Schulze *
3  * All rights reserved. *
4  * http://www.NightLabs.de *
5  * *
6  * This program and the accompanying materials are free software; you can re- *
7  * distribute it and/or modify it under the terms of the GNU General Public *
8  * License as published by the Free Software Foundation; either ver 2 of the *
9  * License, or any later version. *
10  * *
11  * This module is distributed in the hope that it will be useful, but WITHOUT *
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT- *
13  * NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more *
14  * details. *
15  * *
16  * You should have received a copy of the GNU General Public License along *
17  * with this module; if not, write to the Free Software Foundation, Inc.: *
18  * 59 Temple Place, Suite 330 *
19  * Boston MA 02111-1307 *
20  * USA *
21  * *
22  * Or get it online: *
23  * http://www.opensource.org/licenses/gpl-license.php *
24  * *
25  * In case, you want to use this module or parts of it in a proprietary pro- *
26  * ject, you can purchase it under the NightLabs Commercial License. Please *
27  * contact NightLabs GmbH under info AT nightlabs DOT com for more infos or *
28  * visit http://www.NightLabs.com *
29  * ************************************************************************** */

30
31 /*
32  * Created on 17.10.2004
33  */

34 package com.nightlabs.inheritance;
35
36 /**
37  * @author Marco Schulze - marco at nightlabs dot de
38  */

39 public interface FieldMetaData
40 {
41     /**
42      * @return Returns the field name.
43      */

44     String JavaDoc getFieldName();
45
46     static final byte WRITABLEBYCHILDREN_NO = 0;
47     static final byte WRITABLEBYCHILDREN_YES = 1;
48     static final byte WRITABLEBYCHILDREN_INHERITED = 2;
49
50     /**
51      * @return Returns whether or not the children are allowed to write into the field. It is a bitmask.
52      */

53     byte getWritableByChildren();
54
55     /**
56      * Sets whether or not children may change the value.
57      *
58      * @param writableByChildren
59      */

60     void setWritableByChildren(byte writableByChildren);
61
62     /**
63      * @return Returns whether the value of the field may be written.
64      * This method must return false if the mother's writableByChildren
65      * is false.
66      */

67     boolean isWritable();
68
69     /**
70      * This method should check via isWritable whether the field may be written
71      * and throw an NotWritableException, if it's not.
72      *
73      * @throws NotWritableException If the field is not writable
74      */

75     void assertWritable()
76         throws NotWritableException;
77
78     /**
79      * Sets whether or not the value may be written. This method
80      * is called by the engine if the mother's writableByChildren
81      * is altered.
82      *
83      * @param writable
84      */

85     void setWritable(boolean writable);
86
87     /**
88      * @return Whether the value stored in the field is set on child
89      * level or inherited from the mother. If the mother's value changes,
90      * the child's value is updated automatically, if this method returns
91      * true.
92      */

93     boolean isValueInherited();
94
95     /**
96      * @param valueInherited
97      */

98     void setValueInherited(boolean valueInherited);
99
100 }
101
Popular Tags