* @param builtInModuleName The name of the built in module.
* @return A ModuleSourceDefinition object
*/
private static ModuleSourceDefinition makeSourceDefFromBuiltIn (ModuleName builtInModuleName, CALWorkspace workspace) {
final ResourceStore sourceStore = workspace.getSourceManager(builtInModuleName).getResourceStore();
final CALFeatureName moduleFeatureName = CALFeatureName.getModuleFeatureName(builtInModuleName);
final ResourceName moduleResourceName = new ResourceName(moduleFeatureName);
return new ModuleSourceDefinition(builtInModuleName) {
@Override
public InputStream getInputStream(Status status) {
return sourceStore.getInputStream(moduleResourceName);
}
@Override
public long getTimeStamp() {
return sourceStore.getTimeStamp(moduleResourceName);
}
@Override
public String getDebugInfo() {
return sourceStore.getDebugInfo(moduleResourceName);
}
};
}