1 /*
2 * Copyright 2005,2009 Ivan SZKIBA
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.ini4j.sample;
17
18 import java.beans.PropertyChangeListener;
19 import java.beans.PropertyVetoException;
20 import java.beans.VetoableChangeListener;
21
22 import java.net.URI;
23
24 //<editor-fold defaultstate="collapsed" desc="apt documentation">
25 //|
26 //| ---------------
27 //| Dwarf interface
28 //|
29 //|Dwarf interface
30 //|
31 //| This is a very simple bean interface with a few getter and setter. Some of
32 //| the properties are java primitive types. The <<<homePage>>> property has a
33 //| complex type (java.net.URI). It is not a problem for \[ini4j\] to do the
34 //| required type conversion automatically between java.lang.String and the tpye
35 //| of the given property. The <<<fortuneNumber>>> property is indexed, just to
36 //| show you may use indexed properties as well.
37 //|
38 //</editor-fold>
39 //{
40 public interface Dwarf
41 {
42 String PROP_AGE = "age";
43 String PROP_FORTUNE_NUMBER = "fortuneNumber";
44 String PROP_HEIGHT = "height";
45 String PROP_HOME_DIR = "homeDir";
46 String PROP_HOME_PAGE = "homePage";
47 String PROP_WEIGHT = "weight";
48
49 int getAge();
50
51 void setAge(int age);
52
53 int[] getFortuneNumber();
54
55 void setFortuneNumber(int[] value);
56
57 double getHeight();
58
59 void setHeight(double height) throws PropertyVetoException;
60
61 String getHomeDir();
62
63 void setHomeDir(String dir);
64
65 URI getHomePage();
66
67 void setHomePage(URI location);
68
69 double getWeight();
70
71 void setWeight(double weight);
72
73 void addPropertyChangeListener(String property, PropertyChangeListener listener);
74
75 void addVetoableChangeListener(String property, VetoableChangeListener listener);
76
77 boolean hasAge();
78
79 boolean hasHeight();
80
81 boolean hasHomePage();
82
83 boolean hasWeight();
84
85 void removePropertyChangeListener(String property, PropertyChangeListener listener);
86
87 void removeVetoableChangeListener(String property, VetoableChangeListener listener);
88 }
89 //}