Adapted the code style to match the overall code style of iPOJO
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1159950 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndJarResourceStore.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndJarResourceStore.java
index 68432e3..1755467 100644
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndJarResourceStore.java
+++ b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndJarResourceStore.java
@@ -39,18 +39,18 @@
public class BndJarResourceStore implements ResourceStore {
- private Analyzer analyzer;
- private Reporter reporter;
+ private Analyzer m_analyzer;
+ private Reporter m_reporter;
- private MetadataRenderer renderer = new MetadataRenderer();
+ private MetadataRenderer m_renderer = new MetadataRenderer();
public BndJarResourceStore(Analyzer analyzer, Reporter reporter) {
- this.analyzer = analyzer;
- this.reporter = reporter;
+ m_analyzer = analyzer;
+ m_reporter = reporter;
}
public byte[] read(String path) throws IOException {
- Resource resource = analyzer.getJar().getResource(path);
+ Resource resource = m_analyzer.getJar().getResource(path);
InputStream is = null;
try {
is = resource.openInputStream();
@@ -66,7 +66,7 @@
// Only visit classes annotated with @Component or @Handler
String annotations = Component.class.getName() + "|" + Handler.class.getName();
- Collection<Clazz> classes = analyzer.getClasses("",
+ Collection<Clazz> classes = m_analyzer.getClasses("",
Clazz.QUERY.ANNOTATION.name(), annotations,
Clazz.QUERY.NAMED.name(), "*");
@@ -75,7 +75,7 @@
visitor.visit(clazz.getPath());
}
} catch (Exception e) {
- reporter.error("Cannot find iPOJO annotated types: " + e.getMessage());
+ m_reporter.error("Cannot find iPOJO annotated types: " + e.getMessage());
}
}
@@ -87,30 +87,30 @@
// Find referred packages and add them into Bnd
for (String referred : Metadatas.findReferredPackages(metadata)) {
- if (analyzer.getReferred().get(referred) == null) {
+ if (m_analyzer.getReferred().get(referred) == null) {
// The given package is not referred ATM
- analyzer.getReferred().put(referred, new HashMap<String, String>());
+ m_analyzer.getReferred().put(referred, new HashMap<String, String>());
}
}
// Write the iPOJO header
- String components = analyzer.getProperty("IPOJO-Components");
+ String components = m_analyzer.getProperty("IPOJO-Components");
StringBuilder builder = new StringBuilder();
if (components != null) {
builder.append(components);
}
- builder.append(renderer.render(metadata));
+ builder.append(m_renderer.render(metadata));
if (builder.length() != 0) {
- analyzer.setProperty("IPOJO-Components", builder.toString());
+ m_analyzer.setProperty("IPOJO-Components", builder.toString());
}
}
public void write(String resourcePath, byte[] resource) throws IOException {
- Jar jar = analyzer.getJar();
+ Jar jar = m_analyzer.getJar();
jar.putResource(resourcePath, new ByteArrayResource(resource));
}
@@ -120,21 +120,21 @@
Map<String, String> version = new TreeMap<String, String>();
version.put("version", Pojoization.IPOJO_PACKAGE_VERSION);
- if (analyzer.getReferred().get("org.apache.felix.ipojo") == null) {
- analyzer.getReferred().put("org.apache.felix.ipojo", version);
+ if (m_analyzer.getReferred().get("org.apache.felix.ipojo") == null) {
+ m_analyzer.getReferred().put("org.apache.felix.ipojo", version);
}
- if (analyzer.getReferred().get("org.apache.felix.ipojo.architecture") == null) {
- analyzer.getReferred().put("org.apache.felix.ipojo.architecture", version);
+ if (m_analyzer.getReferred().get("org.apache.felix.ipojo.architecture") == null) {
+ m_analyzer.getReferred().put("org.apache.felix.ipojo.architecture", version);
}
- if (analyzer.getReferred().get("org.osgi.service.cm") == null) {
+ if (m_analyzer.getReferred().get("org.osgi.service.cm") == null) {
Map<String, String> cm = new TreeMap<String, String>();
cm.put("version", "1.2");
- analyzer.getReferred().put("org.osgi.service.cm", cm);
+ m_analyzer.getReferred().put("org.osgi.service.cm", cm);
}
- if (analyzer.getReferred().get("org.osgi.service.log") == null) {
+ if (m_analyzer.getReferred().get("org.osgi.service.log") == null) {
Map<String, String> log = new TreeMap<String, String>();
log.put("version", "1.3");
- analyzer.getReferred().put("org.osgi.service.log", log);
+ m_analyzer.getReferred().put("org.osgi.service.log", log);
}
}
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndReporter.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndReporter.java
index 127a420..8625853 100644
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndReporter.java
+++ b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndReporter.java
@@ -35,7 +35,7 @@
/**
* Bnd reporter.
*/
- private Reporter reporter;
+ private Reporter m_reporter;
/**
* Errors which occur during the manipulation.
@@ -48,7 +48,7 @@
private List<String> m_warnings = new ArrayList<String>();
public BndReporter(aQute.libg.reporter.Reporter reporter) {
- this.reporter = reporter;
+ m_reporter = reporter;
}
public List<String> getErrors() {
@@ -61,23 +61,23 @@
@Override
public void trace(String message, Object... args) {
- reporter.trace(message, args);
+ m_reporter.trace(message, args);
}
@Override
public void info(String message, Object... args) {
- reporter.progress(message, args);
+ m_reporter.progress(message, args);
}
@Override
public void warn(String message, Object... args) {
- reporter.warning(message, args);
+ m_reporter.warning(message, args);
m_warnings.add(String.format(message, args));
}
@Override
public void error(String message, Object... args) {
- reporter.error(message, args);
+ m_reporter.error(message, args);
m_errors.add(String.format(message, args));
}
}
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ByteArrayResource.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ByteArrayResource.java
index 90393e1..d97bc39 100644
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ByteArrayResource.java
+++ b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ByteArrayResource.java
@@ -27,15 +27,15 @@
*/
public class ByteArrayResource extends AbstractResource {
- private byte[] content;
+ private byte[] m_content;
public ByteArrayResource(byte[] content) {
super(System.currentTimeMillis());
- this.content = content;
+ m_content = content;
}
@Override
protected byte[] getBytes() throws Exception {
- return content;
+ return m_content;
}
}
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/PojoizationPlugin.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/PojoizationPlugin.java
index 01d30a5..ed359c6 100644
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/PojoizationPlugin.java
+++ b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/PojoizationPlugin.java
@@ -52,26 +52,26 @@
private static final String DEFAULT_METADATA = "META-INF/metadata.xml";
private static final boolean DEFAULT_USE_LOCAL_SCHEMAS = false;
- private String metadata = DEFAULT_METADATA;
- private boolean useLocalSchemas = DEFAULT_USE_LOCAL_SCHEMAS;
+ private String m_metadata = DEFAULT_METADATA;
+ private boolean m_useLocalSchemas = DEFAULT_USE_LOCAL_SCHEMAS;
- private Reporter reporter;
+ private Reporter m_reporter;
public void setProperties(Map<String, String> configuration) {
// Use metadata file if any
if (configuration.containsKey(PROPERTY_METADATA)) {
- metadata = configuration.get(PROPERTY_METADATA);
+ m_metadata = configuration.get(PROPERTY_METADATA);
}
// Use local schemas ?
if (configuration.containsKey(PROPERTY_USE_LOCAL_SCHEMAS)) {
- useLocalSchemas = true;
+ m_useLocalSchemas = true;
}
}
public void setReporter(Reporter reporter) {
- this.reporter = reporter;
+ m_reporter = reporter;
}
public boolean analyzeJar(Analyzer analyzer) throws Exception {
@@ -79,26 +79,26 @@
long start = System.currentTimeMillis();
// Wraps the Bnd Reporter
- BndReporter reporter = new BndReporter(this.reporter);
+ BndReporter reporter = new BndReporter(this.m_reporter);
// Build ResourceStore
- BndJarResourceStore store = new BndJarResourceStore(analyzer, this.reporter);
+ BndJarResourceStore store = new BndJarResourceStore(analyzer, this.m_reporter);
// Build MetadataProvider
CompositeMetadataProvider provider = new CompositeMetadataProvider(reporter);
- File file = new File(metadata);
+ File file = new File(m_metadata);
if (file.exists()) {
// Absolute file system resource
FileMetadataProvider fmp = new FileMetadataProvider(file, reporter);
- fmp.setValidateUsingLocalSchemas(useLocalSchemas);
+ fmp.setValidateUsingLocalSchemas(m_useLocalSchemas);
provider.addMetadataProvider(fmp);
} else {
// In archive resource
- Resource resource = analyzer.getJar().getResource(metadata);
+ Resource resource = analyzer.getJar().getResource(m_metadata);
if (resource != null) {
ResourceMetadataProvider rmp = new ResourceMetadataProvider(resource, reporter);
- rmp.setValidateUsingLocalSchemas(useLocalSchemas);
+ rmp.setValidateUsingLocalSchemas(m_useLocalSchemas);
provider.addMetadataProvider(rmp);
}
}
@@ -110,7 +110,7 @@
}
Pojoization pojoization = new Pojoization(reporter);
- if (useLocalSchemas) {
+ if (m_useLocalSchemas) {
pojoization.setUseLocalXSD();
}
@@ -118,7 +118,7 @@
int nbComponents = findElements(cache.getMetadatas(), "component").size();
int nbHandlers = findElements(cache.getMetadatas(), "handler").size();
- this.reporter.progress("iPOJO manipulation performed performed in %s ms (%d components, %d handlers).",
+ this.m_reporter.progress("iPOJO manipulation performed performed in %s ms (%d components, %d handlers).",
(System.currentTimeMillis() - start),
nbComponents,
nbHandlers);
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ResourceMetadataProvider.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ResourceMetadataProvider.java
index 41c412e..f40e681 100644
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ResourceMetadataProvider.java
+++ b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ResourceMetadataProvider.java
@@ -36,38 +36,38 @@
*/
public class ResourceMetadataProvider implements MetadataProvider {
- private Resource resource;
+ private Resource m_resource;
- private List<Element> cached;
+ private List<Element> m_cached;
- private boolean validateUsingLocalSchemas = false;
+ private boolean m_validateUsingLocalSchemas = false;
- private Reporter reporter;
+ private Reporter m_reporter;
public ResourceMetadataProvider(Resource resource, Reporter reporter) {
- this.resource = resource;
- this.reporter = reporter;
+ m_resource = resource;
+ m_reporter = reporter;
}
public void setValidateUsingLocalSchemas(boolean validateUsingLocalSchemas) {
- this.validateUsingLocalSchemas = validateUsingLocalSchemas;
+ this.m_validateUsingLocalSchemas = validateUsingLocalSchemas;
}
public List<Element> getMetadatas() throws IOException {
- if (cached == null) {
- cached = new ArrayList<Element>();
+ if (m_cached == null) {
+ m_cached = new ArrayList<Element>();
InputStream stream = null;
try {
- stream = resource.openInputStream();
+ stream = m_resource.openInputStream();
} catch (Exception e) {
- reporter.error(e.getMessage());
+ m_reporter.error(e.getMessage());
throw new IOException("Cannot read metadata");
}
- StreamMetadataProvider provider = new StreamMetadataProvider(stream, reporter);
- provider.setValidateUsingLocalSchemas(validateUsingLocalSchemas);
- cached.addAll(provider.getMetadatas());
+ StreamMetadataProvider provider = new StreamMetadataProvider(stream, m_reporter);
+ provider.setValidateUsingLocalSchemas(m_validateUsingLocalSchemas);
+ m_cached.addAll(provider.getMetadatas());
}
- return cached;
+ return m_cached;
}
}