1   package com.stateofflow.eclipse.metrics.export.wizard;
2   
3   import org.eclipse.core.runtime.CoreException;
4   import org.eclipse.core.runtime.QualifiedName;
5   import org.eclipse.jdt.core.IJavaProject;
6   
7   class ProjectProperties {
8       private final IJavaProject project;
9   
10      public ProjectProperties(final IJavaProject project) {
11          this.project = project;
12      }
13  
14      public boolean getBoolean(final QualifiedName propertyName, final boolean defaultValue) throws CoreException {
15          final String enabled = getString(propertyName);
16          return enabled != null ? Boolean.valueOf(enabled).booleanValue() : defaultValue;
17      }
18  
19      public String getString(final QualifiedName propertyName) throws CoreException {
20          return project.getProject().getPersistentProperty(propertyName);
21      }
22  
23      public IJavaProject getProject() {
24          return project;
25      }
26  }