001    /*
002     * Copyright 2005,2009 Ivan SZKIBA
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.ini4j.sample;
017    
018    import java.beans.PropertyChangeListener;
019    import java.beans.PropertyVetoException;
020    import java.beans.VetoableChangeListener;
021    
022    import java.net.URI;
023    
024    //<editor-fold defaultstate="collapsed" desc="apt documentation">
025    //|
026    //|                ---------------
027    //|                Dwarf interface
028    //|
029    //|Dwarf interface
030    //|
031    //| This is a very simple bean interface with a few getter and setter. Some of
032    //| the properties are java primitive types. The <<<homePage>>> property has a
033    //| complex type (java.net.URI). It is not a problem for \[ini4j\] to do the
034    //| required type conversion automatically between java.lang.String and the tpye
035    //| of the given property. The <<<fortuneNumber>>> property is indexed, just to
036    //| show you may use indexed properties as well.
037    //|
038    //</editor-fold>
039    //{
040    public interface Dwarf
041    {
042        String PROP_AGE = "age";
043        String PROP_FORTUNE_NUMBER = "fortuneNumber";
044        String PROP_HEIGHT = "height";
045        String PROP_HOME_DIR = "homeDir";
046        String PROP_HOME_PAGE = "homePage";
047        String PROP_WEIGHT = "weight";
048    
049        int getAge();
050    
051        void setAge(int age);
052    
053        int[] getFortuneNumber();
054    
055        void setFortuneNumber(int[] value);
056    
057        double getHeight();
058    
059        void setHeight(double height) throws PropertyVetoException;
060    
061        String getHomeDir();
062    
063        void setHomeDir(String dir);
064    
065        URI getHomePage();
066    
067        void setHomePage(URI location);
068    
069        double getWeight();
070    
071        void setWeight(double weight);
072    
073        void addPropertyChangeListener(String property, PropertyChangeListener listener);
074    
075        void addVetoableChangeListener(String property, VetoableChangeListener listener);
076    
077        boolean hasAge();
078    
079        boolean hasHeight();
080    
081        boolean hasHomePage();
082    
083        boolean hasWeight();
084    
085        void removePropertyChangeListener(String property, PropertyChangeListener listener);
086    
087        void removeVetoableChangeListener(String property, VetoableChangeListener listener);
088    }
089    //}