does anyone see anything strange in my code?
This is parser factory class which store instances of parsers. I have in text file saved informations objects in database usualy in format
/table/something/something
nameoftablecolumn/info/info/...
etc.
I have class for parsing this text file, the parsers can parse different lines. For example if the line starts /table/ i'll choose table parser calling getParser("table"). When I want to parse the views, I have some problem. I tried to find it by debuging in Eclipse, but It says me that source is not found and shows class not found exception in list of actions in debuging .. but no exception in program ..
This happens when I jump by F5 to the constructor of ParserFactory.
There is code of this class:
/**
*
*/
package appInspector.input.parser;
import java.util.HashMap;
import appInspector.input.parser.database.SourceParser;
import appInspector.input.parser.database.TableParser;
import appInspector.input.parser.database.ViewParser;
import appInspector.input.parser.filesystem.DirectoryParser;
import appInspector.input.parser.filesystem.FileParser;
/**
*
*/
public class ParserFactory {
private HashMap<String, IParser> parsers = new HashMap<String, IParser>();
private ParserFactory() {
//filesystem
parsers.put("directory", new DirectoryParser());
parsers.put("file", new FileParser());
//table
parsers.put("table", new TableParser());
//view
parsers.put("view", new ViewParser());
//source
parsers.put("source", new SourceParser());
}
public static ParserFactory newInstance(){
return new ParserFactory();
}
public IParser getParser(String key) {
IParser parser = parsers.get(key);
if(parser == null ){
System.out.println("Nepodporovaný objekt");
}
return parser;
}
}
EDIT: I have similar problem like there (similar output - mean the source not found). Eclipse debugging "source not found"