KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > arooa > RuntimeConfiguration


1 package org.oddjob.arooa;
2
3 import java.util.Enumeration JavaDoc;
4
5 import org.oddjob.arooa.reflect.RegistryLookup;
6
7 /**
8  */

9 public interface RuntimeConfiguration {
10
11     /**
12      * Get the object for which this RuntimeConfigurable holds the configuration
13      * information
14      *
15      * @return the object whose configure is held by this instance.
16      */

17     public Object JavaDoc getWrappedObject();
18     
19     /**
20      * Returns the tag name of the wrapped element.
21      *
22      * @return The tag name of the wrapped element. This is unlikely
23      * to be <code>null</code>, but may be.
24      */

25     public String JavaDoc getElementTag();
26         
27     /**
28      * Get the text for an attribute.
29      *
30      * @param name The attribute name.
31      * @return The attributes text. Null if it's inline.
32      */

33     public String JavaDoc getAttribute(String JavaDoc name);
34     
35     /**
36      * Adds a child element to the wrapped element.
37      *
38      * @param child The child element wrapper to add to this one.
39      * Must not be <code>null</code>.
40      */

41     public void addChild(RuntimeConfiguration child);
42
43     /**
44      * Adds characters from #PCDATA areas to the wrapped element.
45      *
46      * @param buf A character array of the text within the element.
47      * Must not be <code>null</code>.
48      * @param start The start element in the array.
49      * @param count The number of characters to read from the array.
50      *
51      */

52     public void addText(char[] buf, int start, int count);
53     
54     /**
55      * Returns an enumeration of all child wrappers.
56      * @return an enumeration of the child wrappers.
57      */

58     public Enumeration JavaDoc getChildren();
59     
60     /**
61      * Configures the wrapped element. The attributes and text for
62      * the wrapped element are configured. Each time the wrapper is
63      * configured, the attributes and text for it are reset.
64      *
65      * If the element has an <code>id</code> attribute, a reference
66      * is added to the project as well.
67      *
68      * @param p The project containing the wrapped element.
69      * Must not be <code>null</code>.
70      *
71      * @param configureChildren Whether to configure child elements as
72      * well. if true, child elements will be configured after the
73      * wrapped element.
74      *
75      * @exception ArooaException if the configuration fails, for instance due
76      * to invalid attributes or children, or text being added to
77      * an element which doesn't accept it.
78      */

79
80     public void configure(RegistryLookup registry, boolean nullAllowed)
81     throws ArooaException;
82         
83     public void configure()
84     throws ArooaException;
85 }
86
Popular Tags