Skip to main content
summaryrefslogtreecommitdiffstats
blob: 65cdf850ce5d73a398ae3336278bd7214d338111 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*******************************************************************************
 * Copyright (c) 2010, 2011 Oracle. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0, which accompanies this distribution
 * and is available at http://www.eclipse.org/legal/epl-v10.html.
 * 
 * Contributors:
 *     Oracle - initial API and implementation
 ******************************************************************************/
package org.eclipse.jpt.jaxb.core.context;

import java.util.List;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;

/**
 * Root of the JAXB context model.
 * <p>
 * Provisional API: This interface is part of an interim API that is still
 * under development and expected to change significantly before reaching
 * stability. It is available at this early stage to solicit feedback from
 * pioneering adopters on the understanding that any code that uses this API
 * will almost certainly be broken (repeatedly) as the API evolves.
 * 
 * @version 3.0
 * @since 3.0
 */
public interface JaxbContextRoot
		extends JaxbContextNode {
	
	/**
	 * The set of packages.  Includes any package with any interesting JAXB content.
	 */
	Iterable<JaxbPackage> getPackages();
	public final static String PACKAGES_COLLECTION = "packages"; //$NON-NLS-1$
	
	int getPackagesSize();

	/**
	 * Return the package with the given name
	 */
	JaxbPackage getPackage(String packageName);
	
	/**
	 * Return the set of all JAXB types within this context root.
	 */
	Iterable<JaxbType> getTypes();
	public final static String TYPES_COLLECTION = "types"; //$NON-NLS-1$
	
	int getTypesSize();
	
	/**
	 * Return the type with the given name
	 */
	JaxbType getType(String typeName);
	
	/**
	 * Return the set of types that are in the given package
	 */
	Iterable<JaxbType> getTypes(JaxbPackage jaxbPackage);
	
	/**
	 * The set of persistent classes.  These may be explicitly or implicitly included.
	 */
	Iterable<JaxbPersistentClass> getPersistentClasses();
	
	/**
	 * Return the set of persistent classes that are in the given package
	 */
	Iterable<JaxbPersistentClass> getPersistentClasses(JaxbPackage jaxbPackage);

	/**
	 * Return the persistent class with the given fully qualified name
	 */
	JaxbPersistentClass getPersistentClass(String fullyQualifiedTypeName);

	/**
	 * The set of persistent enums.  These may be explicitly or implicitly included.
	 */
	Iterable<JaxbPersistentEnum> getPersistentEnums();

	/**
	 * Return the set of persistent enums that are in the given package
	 */
	Iterable<JaxbPersistentEnum> getPersistentEnums(JaxbPackage jaxbPackage);

	/**
	 * Return the persistent enum with the given fully qualified name
	 */
	JaxbPersistentEnum getPersistentEnum(String fullyQualifiedTypeName);

	/**
	 * The set of registries.
	 */
	Iterable<JaxbRegistry> getRegistries();
	
	/**
	 * Return the set of registries that are in the given package
	 * (There should typically be a max of 1, but there are invalid states ...)
	 */
	Iterable<JaxbRegistry> getRegistries(JaxbPackage jaxbPackage);

	/**
	 * The set of transient classes.
	 */
	Iterable<JaxbTransientClass> getTransientClasses();

	/**
	 * Return the set of transient classes that are in the given package
	 */
	Iterable<JaxbTransientClass> getTransientClasses(JaxbPackage jaxbPackage);

	/**
	 * Return the transient class with the given fully qualified name
	 */
	JaxbTransientClass getTransientClass(String fullyQualifiedTypeName);


	/**
	 * Return the persistent class or transient type with the given fully qualified name
	 */
	JaxbClass getClass(String fullyQualifiedTypeName);

	// **************** validation ********************************************
	
	/**
	 * Add validation messages to the specified list.
	 */
	public void validate(List<IMessage> messages, IReporter reporter);
}

Back to the top