KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > zeus > Binder


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  */

19 package org.enhydra.zeus;
20
21 import java.io.IOException JavaDoc;
22 import java.util.List JavaDoc;
23
24 /**
25  * <p>
26  * <code>Binder</code> provides an interface for all constraint
27  * representations to use. It defines the contract for conversion
28  * between an arbitrary constraint representation (XML Schema, DTD,
29  * Relax schema, etc) to a set of Zeus
30  * <code>{@link Binding}</code>s.
31  * </p><p>
32  * This interface also provides uniformity in the overall handling
33  * of constraints; in other words, dealing with an XML Schema is
34  * generally fundamentally different than dealing with a DTD.
35  * However, working with a <code>DTDBinder</code> is identical,
36  * from an external perspective, to working with a
37  * <code>SchemaBinder</code>.
38  * </p>
39  *
40  * @author Brett McLaughlin
41  * @author Maciej Zawadzki
42  */

43 public interface Binder {
44
45     /**
46      * <p>
47      * This sets whether or not to "collapse" simple elements. An element is
48      * simple if it only has character-based content, and no attributes. If
49      * these are collapsed, then they are not turned into full-fledged
50      * Java objects (with only a <code>getValue()</code> method), but instead
51      * become properties with primitive return values on their parents. So
52      * an element named "display-name" with only textual content could be
53      * accessed through it's parent object by invoking
54      * <code>getDisplayName()</code> on the parent, instead of
55      * <code>getDisplayName().getValue()</code>. By default, elements are
56      * <i>not</i> collapsed.
57      * </p>
58      *
59      * @param isCollapsingSimpleElements whether or not to collapse simple
60      * elements.
61      */

62     public void setIsCollapsingSimpleElements(
63         boolean isCollapsingSimpleElements);
64         
65     /**
66      * <p>
67      * This will indicate whether simple elements are being collapsed for
68      * this binder. An element is
69      * simple if it only has character-based content, and no attributes. If
70      * these are collapsed, then they are not turned into full-fledged
71      * Java objects (with only a <code>getValue()</code> method), but instead
72      * become properties with primitive return values on their parents. So
73      * an element named "display-name" with only textual content could be
74      * accessed through it's parent object by invoking
75      * <code>getDisplayName()</code> on the parent, instead of
76      * <code>getDisplayName().getValue()</code>. By default, elements are
77      * <i>not</i> collapsed.
78      * </p>
79      *
80      * @return <code>boolean</code> - whether simple elements are being
81      * collapsed.
82      */

83     public boolean isCollapsingSimpleElements();
84     
85     /**
86      * <p>
87      * This indicates if the <code>id</code> attribute on elements handled by
88      * this <code>Binder</code> should be ignored in determine if an
89      * element is collapsible. If
90      * <code>{@link #isCollapsingSimpleElements}</code> is false, this has
91      * no effect.
92      * </p>
93      *
94      * @param ignoringIDAttributes whether or not to ignore ID attributes.
95      */

96     public void setIsIgnoringIDAttributes(boolean isIgnoringIDAttributes);
97     
98     /**
99      * <p>
100      * This will indicate if the <code>id</code> attribute on elements handled
101      * by this <code>Binder</code> should be ignored in determine if an
102      * element is collapsible. If
103      * <code>{@link #isCollapsingSimpleElements}</code> is false, this has
104      * no effect.
105      * </p>
106      *
107      * @return <code>boolean</code> - whether ID attributes are ignored.
108      */

109     public boolean isIgnoringIDAttributes();
110     
111     /**
112      * <p>
113      * This is integral portion of the <code>Binder</code>. It
114      * is responsible for returning a Zeus representation of
115      * the set of constraints that this binding represents,
116      * resulting from the input representation (which could
117      * be an XML Schema, DTD, Relax schema, etc.).
118      * </p>
119      *
120      * @return <code>List</code> - the resultant
121      * <code>Binding</code>s from conversion of
122      * constraints.
123      * @exception <code>IOException</code> when errors in reading
124      * input occur.
125      */

126     public List JavaDoc getBindings() throws IOException JavaDoc;
127 }
128
Popular Tags