Source code: com/port80/util/attr/IAttrFactory.java
1 //
2 // Copyright(c) 2002, Chris Leung
3 //
4
5 package com.port80.util.attr;
6
7
8 /** Attribute factory interface provide methods for attribute
9 * creation, type conversion and user interface.
10 *
11 * . The attribute registry maintains a name->AttrFactory table.
12 * . The attribute type methods are used to serialize and
13 * de-serialize attributes.
14 */
15 public interface IAttrFactory {
16
17 ////////////////////////////////////////////////////////////////////////
18
19 /** Create an appropriate object from the String representation of the attribute. */
20 Object createObject(String name);
21 /** Check that given object is valid value for this factory. */
22 boolean isValid(Object object);
23 /** The String representation of an attribute value. */
24 String toString(Object object);
25 /** The String representation of attribute type itself. */
26 String toString();
27 /** Prompt user and present a user interface to obtain an
28 * attribute value from user. */
29 Object promptUser(String prompt);
30
31 ////////////////////////////////////////////////////////////////////////
32 }
33