KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > dtd > IModel


1 /*******************************************************************************
2  * Copyright (c) 2002, 2005 Object Factory Inc.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * Object Factory Inc. - Initial implementation
10  *******************************************************************************/

11 package org.eclipse.ant.internal.ui.dtd;
12
13 import org.eclipse.ant.internal.ui.dtd.schema.Nfm;
14
15
16 /**
17  * Content model.
18  * This is the printable version of the model.
19  * The walkable version is the IDfm.
20  * @author Bob Foster
21  */

22 public interface IModel {
23
24     public static final int UNKNOWN = 0;
25     public static final int SEQUENCE = 1;
26     public static final int CHOICE = 2;
27     public static final int LEAF = 4;
28     
29     public static final int UNBOUNDED = Integer.MAX_VALUE;
30     
31     /**
32      * @return one of SEQUENCE, CHOICE, LEAF
33      */

34     public int getKind();
35     
36     /**
37      * @return one of 0 or 1.
38      */

39     public int getMinOccurs();
40     
41     /**
42      * @return one of 1 or UNBOUNDED.
43      */

44     public int getMaxOccurs();
45     
46     /**
47      * @return if SEQUENCE or CHOICE return array of sub-models; otherwise
48      * undefined.
49      */

50     public IModel[] getContents();
51     
52     /**
53      * @return if LEAF return atom; otherwise undefined.
54      */

55     public IAtom getLeaf();
56     
57     /**
58      * @return if SEQUENCE or CHOICE return "," and "|", respectively; otherwise
59      * undefined. Useful when printing model.
60      */

61     public String JavaDoc getOperator();
62     
63     /**
64      * @return one of "", "?", "*" or "+". Useful when printing model.
65      */

66     public String JavaDoc getQualifier();
67     
68     /**
69      * Convert content model to string representation.
70      */

71     public String JavaDoc stringRep();
72     
73     /**
74      * Convert the model to an Nfm on demand.
75      * @return Nfm
76      */

77     public Nfm toNfm();
78 }
79
Popular Tags