Skip to main content
summaryrefslogtreecommitdiffstats
blob: a6a5e04ed7908493b26b29f624fd755204b025ea (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
/*******************************************************************************
 * Copyright (c) 2006, 2007 Oracle Corporation.
 * 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.jst.jsf.common.metadata.internal;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.MissingResourceException;
import java.util.ResourceBundle;


/**
 * Used to supply an InputStream to the parser of an annotation 
 * meta-data file and the URL to the resource bundle for a properties file, if any.
 * 
 * Implementors must provide a zero-argument constructor.
 * 
 * CURRENTLY INTERNAL... WILL BE MADE API AT SOME POINT
 *
 */ 
public abstract class StandardMetaDataSourceFileLocator {
	/**
	 * metadata file to locate
	 */
	protected IStandardMetaDataSourceInfo fileInfo;
	
	/**
	 * Set the <code>IStandardMetaDataSourceInfo</code> for this locator
	 * @param fileInfo
	 */
	public final void setFileInfo(IStandardMetaDataSourceInfo fileInfo){
		this.fileInfo = fileInfo;
	}
	
	/**
	 * @return the <code>IStandardMetaDataSourceInfo</code> for this locator
	 */
	protected final IStandardMetaDataSourceInfo getFileInfo(){
		return fileInfo;
	}
	/**
	 * Return InputStream to the meta-data source file.  
	 * Callers are responsible for closing the stream.
	 * @return InputStream
	 * @throws IOException
	 */
	public abstract InputStream getInputStream() throws IOException;
	
	/**
	 * Return URL to the meta-data source file.  
	 * Must not be null.
	 * @return URL
	 */
	public abstract URL getURL();
	
	/**
	 * Return ResourceBundle for the property files if there are any.  Return null if not.
	 * 
	 * @return java.util.ResourceBundle
	 * @throws IOException
	 * @throws MissingResourceException
	 */
	public abstract ResourceBundle getResourceBundle() throws IOException, MissingResourceException;
}

Back to the top