01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.core.ischema;
11:
12: /**
13: * Compositor is a container that can contain other compositors or
14: * references to element defined at the global scope. Compositors
15: * are used to recursively define content model for the type.
16: * Compositor kind (all, choice, sequence or group) defines
17: * how to interpret its children.
18: */
19: public interface ISchemaCompositor extends ISchemaObject,
20: ISchemaRepeatable {
21: /**
22: * Indicates the root parent of the compositor.
23: */
24: public static final int ROOT = -1;
25: /**
26: * Indicates that the children can be in any order and cardinality.
27: */
28: public static final int ALL = 0;
29: /**
30: * Indicates that an only one of the compositor's children can
31: * appear at this location (DTD eq: "|")
32: */
33: public static final int CHOICE = 1;
34: /**
35: * Indicates that the children must appear in sequence in the schema documents (DTD eq: "," )
36: */
37: public static final int SEQUENCE = 2;
38: /**
39: * Indicates that this compositor simply serves as a group (DTD eq: "()" )
40: */
41: public static final int GROUP = 3;
42: /**
43: * Keyword table for compositors.
44: */
45: public static final String[] kindTable = {
46: "all", "choice", "sequence", "group" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
47:
48: /**
49: * Returns the number of children of this compositor.
50: * @return number of compositor children
51: */
52: public int getChildCount();
53:
54: /**
55: * Returns children of this compositor.
56: * @return compositor children
57: */
58: public ISchemaObject[] getChildren();
59:
60: /**
61: * Returns a flag that defines how the children of this compositors should be
62: * treated when computing type grammar (one of ALL, CHOICE, GROUP, SEQUENCE).
63: * @return compositor kind value
64: */
65: public int getKind();
66: }
|