Skip to main content
summaryrefslogtreecommitdiffstats
blob: d0cb95b29d37574fcf6f98a72c45c4aa5ac76dff (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
/*******************************************************************************
 * Copyright (c) 2001, 2005 IBM Corporation and others.
 * 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:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.j2ee.internal.common;

import org.eclipse.jst.j2ee.application.Application;
import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;


public interface XMLResource extends TranslatorResource, J2EEVersionConstants {
	public static final int APP_CLIENT_TYPE = 1;
	public static final int APPLICATION_TYPE = 2;
	public static final int EJB_TYPE = 3;
	public static final int WEB_APP_TYPE = 4;
	public static final int RAR_TYPE = 5;
	public static final int WEB_SERVICES_CLIENT_TYPE = 6;

	public static final String DELETED_ERROR_MSG = "This resource has been deleted and can no longer be used."; /**
	 * Is this a resource loaded as an alternate deployment descriptor?
	 */
	boolean isAlt();
	public int getJ2EEVersionID();
	public int getModuleVersionID();
	public void setJ2EEVersionID(int id);
	public void setModuleVersionID(int id);
	/**
	 * Used only if this resource is an alt; return the application which declares it
	 */
	Application getApplication();

	void setApplication(Application newApplication);
	/**
	 * @deprecated use {@link #getVersionID()}
	 * @see J2EEVersionConstants
	 */
	boolean isJ2EE1_3();

	/**
	 * Returns the type of this J2EE XMLResource.
	 * You can use this method instead of using instanceof.
	 * @see XMLResource#APP_CLIENT_TYPE
	 * @see XMLResource#APPLICATION_TYPE
	 * @see XMLResource#EJB_TYPE
	 * @see XMLResource#WEB_APP_TYPE
	 * @see XMLResource#RAR_TYPE
	 */
	int getType();
	 /**
	 * Is this a resource loaded as an alternate deployment descriptor?
	 */
	void setIsAlt(boolean isAlternateDD);
	/**
	 * @deprecated use {@link TranslatorResource#setVersionID(int)}, 
	 * {@link TranslatorResource#setDoctypeValues(String, String)}
	 * Sets the system id of the XML document.
	 * @see J2EEVersionConstants
	 */
	void setSystemId(String id);
	/**
	 * @deprecated use {@link TranslatorResource#setVersionID(int)},
	 * {@link TranslatorResource#setDoctypeValues(String, String)}
	 * Sets the public id of the XML document.
	 * @see J2EEVersionConstants
	 */
	void setPublicId(String id);

	//The following methods are to support ReferencedResource without having an actual
	//This may be just a subset of what is available in ReferencedResource
	void saveIfNecessary() throws Exception;
	void releaseFromWrite();
	void releaseFromRead();
	void preDelete();
	boolean isSharedForWrite();
	boolean isShared();
	boolean isReadOnly();
	boolean isNew();
	void accessForWrite();
	void accessForRead(); 

}

Back to the top