Adapted the code style to match the overall code style of iPOJO
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1159881 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ManipulationEngine.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ManipulationEngine.java
index 68deec4..aa5eb2f 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ManipulationEngine.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ManipulationEngine.java
@@ -36,7 +36,7 @@
/**
* List of component types.
*/
- private List<ManipulationUnit> manipulationUnits = new ArrayList<ManipulationUnit>();
+ private List<ManipulationUnit> m_manipulationUnits = new ArrayList<ManipulationUnit>();
/**
* Error reporting.
@@ -51,25 +51,25 @@
/**
* The visitor handling output result.
*/
- private ManipulationVisitor manipulationVisitor;
+ private ManipulationVisitor m_manipulationVisitor;
/**
* Add information related to a discovered component that will be manipulated.
* @param component additional component
*/
public void addManipulationUnit(ManipulationUnit component) {
- manipulationUnits.add(component);
+ m_manipulationUnits.add(component);
}
public void setManipulationVisitor(ManipulationVisitor manipulationVisitor) {
- this.manipulationVisitor = manipulationVisitor;
+ m_manipulationVisitor = manipulationVisitor;
}
/**
* @param reporter Feedback reporter.
*/
public void setReporter(Reporter reporter) {
- this.m_reporter = reporter;
+ m_reporter = reporter;
}
/**
@@ -78,7 +78,7 @@
* @param store Helps to locate bytecode for classes.
*/
public void setResourceStore(ResourceStore store) {
- this.m_store = store;
+ m_store = store;
}
/**
@@ -89,7 +89,7 @@
// Iterates over the list of discovered components
// Note that this list includes components from metadata.xml AND from annotations
- for (ManipulationUnit info : manipulationUnits) {
+ for (ManipulationUnit info : m_manipulationUnits) {
byte[] bytecode;
try {
@@ -100,7 +100,7 @@
}
// Is the visitor interested in this component ?
- ManipulationResultVisitor result = manipulationVisitor.visitManipulationResult(info.getComponentMetadata());
+ ManipulationResultVisitor result = m_manipulationVisitor.visitManipulationResult(info.getComponentMetadata());
if (result != null) {
// Should always be the case
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ManipulationUnit.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ManipulationUnit.java
index 120f541..d25391e 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ManipulationUnit.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ManipulationUnit.java
@@ -40,9 +40,9 @@
* @param meta component type metadata
*/
public ManipulationUnit(String resourcePath, Element meta) {
- this.m_resourcePath = resourcePath;
- this.m_componentMetadata = meta;
- this.m_className = Strings.asClassName(resourcePath);
+ m_resourcePath = resourcePath;
+ m_componentMetadata = meta;
+ m_className = Strings.asClassName(resourcePath);
}
/**
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
index a9a3cae..0f8f395 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
@@ -77,7 +77,7 @@
}
public Pojoization(Reporter m_reporter) {
- this.m_reporter = m_reporter;
+ m_reporter = m_reporter;
}
/**
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/manifest/DirectManifestProvider.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/manifest/DirectManifestProvider.java
index 519913d..e4dc187 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/manifest/DirectManifestProvider.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/manifest/DirectManifestProvider.java
@@ -32,17 +32,17 @@
/**
* Served Manifest.
*/
- private Manifest manifest;
+ private Manifest m_manifest;
/**
* Construct a provider servicing the given manifest.
* @param manifest Manifest to be serviced
*/
public DirectManifestProvider(Manifest manifest) {
- this.manifest = manifest;
+ m_manifest = manifest;
}
public Manifest getManifest() {
- return manifest;
+ return m_manifest;
}
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/manifest/FileManifestProvider.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/manifest/FileManifestProvider.java
index 3299d15..81e723e 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/manifest/FileManifestProvider.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/manifest/FileManifestProvider.java
@@ -37,7 +37,7 @@
/**
* Read manifest.
*/
- private Manifest manifest;
+ private Manifest m_manifest;
/**
* Read the manifest from the given input file
@@ -46,17 +46,17 @@
* or if the file is not a valid manifest.
*/
public FileManifestProvider(File resource) throws IOException {
- manifest = new Manifest();
+ m_manifest = new Manifest();
InputStream is = null;
try {
is = new FileInputStream(resource);
- manifest.read(is);
+ m_manifest.read(is);
} finally {
Streams.close(is);
}
}
public Manifest getManifest() {
- return manifest;
+ return m_manifest;
}
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java
index 4a056cd..398f0d7 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java
@@ -37,14 +37,14 @@
*/
public class AnnotationMetadataProvider implements MetadataProvider {
- private ResourceStore store;
+ private ResourceStore m_store;
- private Reporter reporter;
+ private Reporter m_reporter;
public AnnotationMetadataProvider(final ResourceStore store,
final Reporter reporter) {
- this.store = store;
- this.reporter = reporter;
+ this.m_store = store;
+ this.m_reporter = reporter;
}
public List<Element> getMetadatas() throws IOException {
@@ -52,16 +52,16 @@
final List<Element> metadata = new ArrayList<Element>();
- store.accept(new ResourceVisitor() {
+ m_store.accept(new ResourceVisitor() {
public void visit(String name) {
if (name.endsWith(".class")) {
// Read file's content
byte[] data = null;
try {
- data = store.read(name);
+ data = m_store.read(name);
} catch (IOException e) {
- reporter.warn("Cannot read content of " + name);
+ m_reporter.warn("Cannot read content of " + name);
}
// We check the array size to avoid manipulating empty files
@@ -69,7 +69,7 @@
if (data != null && data.length > 0) {
computeAnnotations(data, metadata);
} else {
- reporter.error("Cannot compute annotations from " + name + " : Empty file");
+ m_reporter.error("Cannot compute annotations from " + name + " : Empty file");
}
}
}
@@ -90,7 +90,7 @@
cr.accept(collector, 0);
if (collector.isIgnoredBecauseOfMissingComponent()) {
- // No @Component, just skip.
+ // No @Component, just skip.
//warn("Annotation processing ignored in " + collector.getClassName() + " - @Component missing");
} else if (collector.isComponentType()) {
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/CacheableMetadataProvider.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/CacheableMetadataProvider.java
index b22e2aa..f6affff 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/CacheableMetadataProvider.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/CacheableMetadataProvider.java
@@ -38,24 +38,24 @@
/**
* Delegate.
*/
- private MetadataProvider delegate;
+ private MetadataProvider m_delegate;
/**
* Cached elements.
*/
- private List<Element> cached;
+ private List<Element> m_cached;
public CacheableMetadataProvider(MetadataProvider delegate) {
- this.delegate = delegate;
+ m_delegate = delegate;
}
public List<Element> getMetadatas() throws IOException {
// Only ask the delegate if cache is empty
- if (cached == null) {
- cached = new ArrayList<Element>();
- cached.addAll(delegate.getMetadatas());
+ if (m_cached == null) {
+ m_cached = new ArrayList<Element>();
+ m_cached.addAll(m_delegate.getMetadatas());
}
- return cached;
+ return m_cached;
}
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/CompositeMetadataProvider.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/CompositeMetadataProvider.java
index 87aaf8a..9661aed 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/CompositeMetadataProvider.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/CompositeMetadataProvider.java
@@ -34,20 +34,20 @@
*/
public class CompositeMetadataProvider implements MetadataProvider {
- private List<MetadataProvider> providers = new ArrayList<MetadataProvider>();
- private Reporter reporter;
+ private List<MetadataProvider> m_providers = new ArrayList<MetadataProvider>();
+ private Reporter m_reporter;
public CompositeMetadataProvider(Reporter reporter) {
- this.reporter = reporter;
+ m_reporter = reporter;
}
public void addMetadataProvider(MetadataProvider provider) {
- this.providers.add(provider);
+ m_providers.add(provider);
}
public List<Element> getMetadatas() throws IOException {
List<Element> metadata = new ArrayList<Element>();
- for (MetadataProvider provider : providers) {
+ for (MetadataProvider provider : m_providers) {
List<Element> loaded = provider.getMetadatas();
@@ -65,7 +65,7 @@
if (name != null) {
if (isDuplicate(metadata, name)) {
// TODO Try to add more information here, but what ?
- reporter.warn("The component type " + name + " is duplicated.");
+ m_reporter.warn("The component type " + name + " is duplicated.");
} else {
metadata.add(meta);
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/FileMetadataProvider.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/FileMetadataProvider.java
index 55cbc22..4873bcc 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/FileMetadataProvider.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/FileMetadataProvider.java
@@ -41,17 +41,17 @@
/**
* Metadata source (file or directory).
*/
- private File source;
+ private File m_source;
/**
* Feedback reporter.
*/
- private Reporter reporter;
+ private Reporter m_reporter;
/**
* Validate using local schemas or not ?
*/
- private boolean validateUsingLocalSchemas = false;
+ private boolean m_validateUsingLocalSchemas = false;
/**
* Constructs a metadata provider using the given source File (directory
@@ -60,18 +60,18 @@
* @param reporter feedback reporter
*/
public FileMetadataProvider(File source, Reporter reporter) {
- this.source = source;
- this.reporter = reporter;
+ m_source = source;
+ m_reporter = reporter;
}
public void setValidateUsingLocalSchemas(boolean validateUsingLocalSchemas) {
- this.validateUsingLocalSchemas = validateUsingLocalSchemas;
+ m_validateUsingLocalSchemas = validateUsingLocalSchemas;
}
public List<Element> getMetadatas() throws IOException {
List<Element> metadata = new ArrayList<Element>();
- traverse(source, metadata);
+ traverse(m_source, metadata);
return metadata;
}
@@ -95,17 +95,17 @@
InputStream stream = null;
URL url = file.toURI().toURL();
if (url == null) {
- reporter.warn("Cannot find the metadata file : " + source.getAbsolutePath());
+ m_reporter.warn("Cannot find the metadata file : " + m_source.getAbsolutePath());
} else {
stream = url.openStream();
- StreamMetadataProvider provider = new StreamMetadataProvider(stream, reporter);
- provider.setValidateUsingLocalSchemas(validateUsingLocalSchemas);
+ StreamMetadataProvider provider = new StreamMetadataProvider(stream, m_reporter);
+ provider.setValidateUsingLocalSchemas(m_validateUsingLocalSchemas);
metadata.addAll(provider.getMetadatas());
}
} catch (MalformedURLException e) {
- reporter.error("Cannot open the metadata input stream from " + source.getAbsolutePath() + ": " + e.getMessage());
+ m_reporter.error("Cannot open the metadata input stream from " + m_source.getAbsolutePath() + ": " + e.getMessage());
} catch (IOException e) {
- reporter.error("Cannot open the metadata input stream: " + source.getAbsolutePath() + ": " + e.getMessage());
+ m_reporter.error("Cannot open the metadata input stream: " + m_source.getAbsolutePath() + ": " + e.getMessage());
}
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/StreamMetadataProvider.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/StreamMetadataProvider.java
index 8cd861b..dd2d891 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/StreamMetadataProvider.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/StreamMetadataProvider.java
@@ -44,22 +44,22 @@
*/
public class StreamMetadataProvider implements MetadataProvider {
- private InputStream stream;
+ private InputStream m_stream;
- private Reporter reporter;
+ private Reporter m_reporter;
- private boolean validateUsingLocalSchemas = false;
+ private boolean m_validateUsingLocalSchemas = false;
public StreamMetadataProvider(InputStream stream, Reporter reporter) {
- this.stream = stream;
- this.reporter = reporter;
+ m_stream = stream;
+ m_reporter = reporter;
}
/**
* Force XML schemas resolution to be performed locally
*/
public void setValidateUsingLocalSchemas(boolean validateUsingLocalSchemas) {
- this.validateUsingLocalSchemas = validateUsingLocalSchemas;
+ m_validateUsingLocalSchemas = validateUsingLocalSchemas;
}
public List<Element> getMetadatas() throws IOException {
@@ -75,12 +75,12 @@
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://apache.org/xml/features/validation/schema", true);
parser.setErrorHandler(handler);
- if (validateUsingLocalSchemas) {
+ if (m_validateUsingLocalSchemas) {
parser.setEntityResolver(new SchemaResolver());
}
// Parse the XML
- InputSource is = new InputSource(stream);
+ InputSource is = new InputSource(m_stream);
parser.parse(is);
Element[] meta = handler.getMetadata();
@@ -91,19 +91,19 @@
// Output a warning message if no metadata was found
if (meta == null || meta.length == 0) {
- reporter.warn("Neither component types, nor instances in the XML metadata");
+ m_reporter.warn("Neither component types, nor instances in the XML metadata");
}
} catch (IOException e) {
- reporter.error("Cannot open the metadata input stream: " + e.getMessage());
+ m_reporter.error("Cannot open the metadata input stream: " + e.getMessage());
} catch (ParseException e) {
- reporter.error("Parsing error when parsing the XML file: " + e.getMessage());
+ m_reporter.error("Parsing error when parsing the XML file: " + e.getMessage());
} catch (SAXParseException e) {
- reporter.error("Error during metadata parsing at line " + e.getLineNumber() + " : " + e.getMessage());
+ m_reporter.error("Error during metadata parsing at line " + e.getLineNumber() + " : " + e.getMessage());
} catch (SAXException e) {
- reporter.error("Parsing error when parsing (Sax Error) the XML file: " + e.getMessage());
+ m_reporter.error("Parsing error when parsing (Sax Error) the XML file: " + e.getMessage());
} finally {
- Streams.close(stream);
+ Streams.close(m_stream);
}
return metadata;
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/render/ManipulatedMetadataFilter.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/render/ManipulatedMetadataFilter.java
index b5d1291..1e262ab 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/render/ManipulatedMetadataFilter.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/render/ManipulatedMetadataFilter.java
@@ -1,28 +1,21 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2011 Bull S.A.S.
- * Contact: jonas-team@ow2.org
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * --------------------------------------------------------------------------
- * $Id: $
- * --------------------------------------------------------------------------
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
-
-
package org.apache.felix.ipojo.manipulator.render;
import org.apache.felix.ipojo.manipulation.MethodCreator;
@@ -30,9 +23,9 @@
import org.apache.felix.ipojo.metadata.Element;
/**
- * A {@code ManipulatedMetadataFilter} is ...
+ * A {@code ManipulatedMetadataFilter}
*
- * @author Guillaume Sauthier
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public class ManipulatedMetadataFilter implements MetadataFilter {
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/render/MetadataRenderer.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/render/MetadataRenderer.java
index e70904f..f44c36f 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/render/MetadataRenderer.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/render/MetadataRenderer.java
@@ -31,7 +31,7 @@
*/
public class MetadataRenderer {
- private List<MetadataFilter> filters = new ArrayList<MetadataFilter>();
+ private List<MetadataFilter> m_filters = new ArrayList<MetadataFilter>();
public MetadataRenderer() {
// By default, filter metadata coming from prior manipulation.
@@ -43,7 +43,7 @@
* @param filter added filter
*/
public void addMetadataFilter(MetadataFilter filter) {
- this.filters.add(filter);
+ m_filters.add(filter);
}
/**
@@ -59,7 +59,7 @@
private void renderElement(Element element, StringBuilder builder) {
- // If the element is already here, do not re-add the element.
+ // If the element is already here, do not re-add the element.
if(!isFiltered(element)) {
// Print the beginning of the element
@@ -127,7 +127,7 @@
private boolean isFiltered(final Element element) {
// Iterates over all the filters and return the first positive answer (if any)
- for (MetadataFilter filter : filters) {
+ for (MetadataFilter filter : m_filters) {
if (filter.accept(element)) {
return true;
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/reporter/EmptyReporter.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/reporter/EmptyReporter.java
index 95b906d..28c4e03 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/reporter/EmptyReporter.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/reporter/EmptyReporter.java
@@ -36,12 +36,12 @@
/**
* List of warnings
*/
- private List<String> warnings = new ArrayList<String>();
+ private List<String> m_warnings = new ArrayList<String>();
/**
* List of errors
*/
- private List<String> errors = new ArrayList<String>();
+ private List<String> m_errors = new ArrayList<String>();
public void trace(String message, Object... args) {}
@@ -52,11 +52,11 @@
public void error(String message, Object... args) {}
public List<String> getErrors() {
- return errors;
+ return m_errors;
}
public List<String> getWarnings() {
- return warnings;
+ return m_warnings;
}
protected Object[] getMessageArguments(Object... args) {
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/DirectoryResourceStore.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/DirectoryResourceStore.java
index f458b1b..b1af78f 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/DirectoryResourceStore.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/DirectoryResourceStore.java
@@ -45,51 +45,51 @@
/**
* Source directory where bytecode is read.
*/
- private File source;
+ private File m_source;
/**
* Target directory.
*/
- private File target;
+ private File m_target;
/**
* The builder of the updated manifest.
*/
- private ManifestBuilder manifestBuilder;
+ private ManifestBuilder m_manifestBuilder;
/**
* Original manifest to be updated.
*/
- private Manifest manifest;
+ private Manifest m_manifest;
/**
* Resource Mapper.
*/
- private ResourceMapper mapper = new FileSystemResourceMapper(new IdentityResourceMapper());
+ private ResourceMapper m_mapper = new FileSystemResourceMapper(new IdentityResourceMapper());
public DirectoryResourceStore(File source) {
this(source, source);
}
public DirectoryResourceStore(File source, File target) {
- this.source = source;
- this.target = target;
+ m_source = source;
+ m_target = target;
}
public void setResourceMapper(ResourceMapper mapper) {
- this.mapper = new FileSystemResourceMapper(mapper);
+ m_mapper = new FileSystemResourceMapper(mapper);
}
public void setManifestBuilder(ManifestBuilder manifestBuilder) {
- this.manifestBuilder = manifestBuilder;
+ m_manifestBuilder = manifestBuilder;
}
public void setManifest(Manifest manifest) {
- this.manifest = manifest;
+ m_manifest = manifest;
}
public byte[] read(String path) throws IOException {
- File resource = new File(source, mapper.internalize(path));
+ File resource = new File(m_source, m_mapper.internalize(path));
if (!resource.isFile()) {
throw new IOException("File '" + resource + "' is not found (for class " + path + ").");
}
@@ -97,7 +97,7 @@
}
public void accept(ResourceVisitor visitor) {
- traverseDirectory(source, visitor);
+ traverseDirectory(m_source, visitor);
}
private void traverseDirectory(File directory, ResourceVisitor visitor) {
@@ -111,17 +111,17 @@
}
private String getRelativeName(File file) {
- String relative = file.getPath().substring(source.getPath().length());
- return mapper.externalize(relative);
+ String relative = file.getPath().substring(m_source.getPath().length());
+ return m_mapper.externalize(relative);
}
public void open() throws IOException {
// Update the manifest
- Manifest updated = manifestBuilder.build(manifest);
+ Manifest updated = m_manifestBuilder.build(m_manifest);
// Write it on disk
- File metaInf = new File(target, "META-INF");
+ File metaInf = new File(m_target, "META-INF");
File resource = new File(metaInf, "MANIFEST.MF");
OutputStream os = new FileOutputStream(resource);
try {
@@ -133,14 +133,14 @@
}
public void writeMetadata(Element metadata) {
- manifestBuilder.addMetada(Collections.singletonList(metadata));
- manifestBuilder.addReferredPackage(Metadatas.findReferredPackages(metadata));
+ m_manifestBuilder.addMetada(Collections.singletonList(metadata));
+ m_manifestBuilder.addReferredPackage(Metadatas.findReferredPackages(metadata));
}
public void write(String resourcePath, byte[] bytecode) throws IOException {
// Internalize the name
- File resource = new File(target, mapper.internalize(resourcePath));
+ File resource = new File(m_target, m_mapper.internalize(resourcePath));
// Create intermediate directories if needed
if (!resource.getParentFile().exists()) {
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/JarFileResourceStore.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/JarFileResourceStore.java
index c9fd3e5..ba1a18a 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/JarFileResourceStore.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/JarFileResourceStore.java
@@ -50,32 +50,32 @@
/**
* Source Jar.
*/
- private JarFile source;
+ private JarFile m_source;
/**
* Target File.
*/
- private File target;
+ private File m_target;
/**
* Modified resources.
*/
- private Map<String, byte[]> content;
+ private Map<String, byte[]> m_content;
/**
* Resource Mapper.
*/
- private ResourceMapper mapper = new IdentityResourceMapper();
+ private ResourceMapper m_mapper = new IdentityResourceMapper();
/**
* The builder of the updated manifest.
*/
- private ManifestBuilder manifestBuilder;
+ private ManifestBuilder m_manifestBuilder;
/**
* Original manifest to be updated.
*/
- private Manifest manifest;
+ private Manifest m_manifest;
/**
* Construct a {@link JarFileResourceStore} wrapping the given original bundle,
@@ -85,45 +85,45 @@
* @throws IOException if there is an error retrieving the Manifest from the original JarFile
*/
public JarFileResourceStore(JarFile source, File target) throws IOException {
- this.source = source;
- this.target = target;
+ m_source = source;
+ m_target = target;
// TODO ensure File is not null and not an existing file/directory
- this.target = target;
+ this.m_target = target;
if (source != null) {
- this.manifest = source.getManifest();
+ m_manifest = source.getManifest();
} else {
- this.manifest = new Manifest();
+ m_manifest = new Manifest();
}
- this.content = new TreeMap<String, byte[]>();
+ m_content = new TreeMap<String, byte[]>();
}
public void setResourceMapper(ResourceMapper mapper) {
- this.mapper = mapper;
+ this.m_mapper = mapper;
}
public void setManifestBuilder(ManifestBuilder manifestBuilder) {
- this.manifestBuilder = manifestBuilder;
+ this.m_manifestBuilder = manifestBuilder;
}
public void setManifest(Manifest manifest) {
- this.manifest = manifest;
+ this.m_manifest = manifest;
}
public byte[] read(String path) throws IOException {
- ZipEntry entry = source.getEntry(getInternalPath(path));
+ ZipEntry entry = m_source.getEntry(getInternalPath(path));
if (entry == null) {
throw new IOException("Jar Entry is not found for class " + path + ".");
}
- return Streams.readBytes(source.getInputStream(entry));
+ return Streams.readBytes(m_source.getInputStream(entry));
}
private String getInternalPath(String path) {
- return mapper.internalize(path);
+ return m_mapper.internalize(path);
}
public void accept(ResourceVisitor visitor) {
- List<JarEntry> entries = Collections.list(source.entries());
+ List<JarEntry> entries = Collections.list(m_source.entries());
for (JarEntry entry : entries) {
String name = entry.getName();
if (!name.endsWith("/")) {
@@ -134,7 +134,7 @@
}
private String getExternalName(String path) {
- return mapper.externalize(path);
+ return m_mapper.externalize(path);
}
public void open() throws IOException {
@@ -142,26 +142,26 @@
}
public void writeMetadata(Element metadata) {
- manifestBuilder.addMetada(Collections.singletonList(metadata));
- manifestBuilder.addReferredPackage(Metadatas.findReferredPackages(metadata));
+ m_manifestBuilder.addMetada(Collections.singletonList(metadata));
+ m_manifestBuilder.addReferredPackage(Metadatas.findReferredPackages(metadata));
}
public void write(String resourcePath, byte[] resource) throws IOException {
- this.content.put(resourcePath, resource);
+ this.m_content.put(resourcePath, resource);
}
public void close() throws IOException {
// Update the manifest
- Manifest updated = manifestBuilder.build(manifest);
+ Manifest updated = m_manifestBuilder.build(m_manifest);
// Create a new Jar file
- FileOutputStream fos = new FileOutputStream(target);
+ FileOutputStream fos = new FileOutputStream(m_target);
JarOutputStream jos = new JarOutputStream(fos, updated);
try {
// Copy classes and resources
- List<JarEntry> entries = Collections.list(source.entries());
+ List<JarEntry> entries = Collections.list(m_source.entries());
for (JarEntry entry : entries) {
// Ignore some entries (MANIFEST, ...)
@@ -173,7 +173,7 @@
// Write newer/updated resource (manipulated classes, ...)
JarEntry je = new JarEntry(entry.getName());
- byte[] data = content.get(getInternalPath(entry.getName()));
+ byte[] data = m_content.get(getInternalPath(entry.getName()));
jos.putNextEntry(je);
jos.write(data);
jos.closeEntry();
@@ -181,7 +181,7 @@
// Copy the resource as-is
jos.putNextEntry(entry);
- InputStream is = source.getInputStream(entry);
+ InputStream is = m_source.getInputStream(entry);
try {
Streams.transfer(is, jos);
} finally {
@@ -194,7 +194,7 @@
}
} finally {
try {
- source.close();
+ m_source.close();
} catch (IOException e) {
// Ignored
}
@@ -208,7 +208,7 @@
if (entry.getName().endsWith(".class")) {
// Need to map this into an external+normalized path
String cleaned = getExternalName(entry.getName());
- return content.containsKey(cleaned);
+ return m_content.containsKey(cleaned);
} else {
return false;
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/builder/DefaultManifestBuilder.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/builder/DefaultManifestBuilder.java
index 4bd08e2..e01fcab 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/builder/DefaultManifestBuilder.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/builder/DefaultManifestBuilder.java
@@ -57,7 +57,7 @@
/**
* The metadata renderer used to print Elements.
*/
- private MetadataRenderer renderer;
+ private MetadataRenderer m_renderer;
/**
* Add all given package names in the referred packages list
@@ -76,7 +76,7 @@
}
public void setMetadataRenderer(MetadataRenderer renderer) {
- this.renderer = renderer;
+ m_renderer = renderer;
}
/**
@@ -125,7 +125,7 @@
// Add referred imports from the metadata
for (int i = 0; i < m_referredPackages.size(); i++) {
String pack = m_referredPackages.get(i);
- imports.put(pack, new TreeMap());
+ imports.put(pack, new TreeMap<String, String>());
}
// Write imports
@@ -141,7 +141,7 @@
private void setPOJOMetadata(Attributes att) {
StringBuilder meta = new StringBuilder();
for (Element metadata : m_metadata) {
- meta.append(renderer.render(metadata));
+ meta.append(m_renderer.render(metadata));
}
if (meta.length() != 0) {
att.putValue("iPOJO-Components", meta.toString());
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/mapper/FileSystemResourceMapper.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/mapper/FileSystemResourceMapper.java
index c2a2b02..120ccfa 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/mapper/FileSystemResourceMapper.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/store/mapper/FileSystemResourceMapper.java
@@ -29,26 +29,26 @@
*/
public class FileSystemResourceMapper implements ResourceMapper {
- private ResourceMapper delegate;
- private char separator;
+ private ResourceMapper m_delegate;
+ private char m_separator;
public FileSystemResourceMapper(ResourceMapper delegate) {
this(delegate, File.separatorChar);
}
public FileSystemResourceMapper(ResourceMapper delegate, char separator) {
- this.delegate = delegate;
- this.separator = separator;
+ m_delegate = delegate;
+ m_separator = separator;
}
public String internalize(String name) {
// transform as system path the result of the internalization operation
- return systemPath(delegate.internalize(name));
+ return systemPath(m_delegate.internalize(name));
}
public String externalize(String name) {
// normalize he path before giving it to the delegate mapper
- return delegate.externalize(normalizePath(name));
+ return m_delegate.externalize(normalizePath(name));
}
/**
@@ -58,7 +58,7 @@
* @return normalized path
*/
private String normalizePath(String path) {
- return path.replace(separator, '/');
+ return path.replace(m_separator, '/');
}
/**
@@ -67,7 +67,7 @@
* @return system path
*/
private String systemPath(String path) {
- return path.replace('/', separator);
+ return path.replace('/', m_separator);
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/ManipulationAdapter.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/ManipulationAdapter.java
index 08934c3..a377bc5 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/ManipulationAdapter.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/ManipulationAdapter.java
@@ -31,21 +31,21 @@
*/
public class ManipulationAdapter implements ManipulationVisitor {
- private ManipulationVisitor delegate;
+ private ManipulationVisitor m_delegate;
public ManipulationAdapter(ManipulationVisitor delegate) {
- this.delegate = delegate;
+ m_delegate = delegate;
}
public ManipulationResultVisitor visitManipulationResult(Element metadata) {
- return new ManipulationResultAdapter(delegate.visitManipulationResult(metadata));
+ return new ManipulationResultAdapter(m_delegate.visitManipulationResult(metadata));
}
public void visitMetadata(Element metadata) {
- delegate.visitMetadata(metadata);
+ m_delegate.visitMetadata(metadata);
}
public void visitEnd() {
- delegate.visitEnd();
+ m_delegate.visitEnd();
}
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/ManipulationResultAdapter.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/ManipulationResultAdapter.java
index 237d3a4..4ae494e 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/ManipulationResultAdapter.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/ManipulationResultAdapter.java
@@ -30,21 +30,21 @@
*/
public class ManipulationResultAdapter implements ManipulationResultVisitor {
- private ManipulationResultVisitor delegate;
+ private ManipulationResultVisitor m_delegate;
public ManipulationResultAdapter(ManipulationResultVisitor delegate) {
- this.delegate = delegate;
+ m_delegate = delegate;
}
public void visitClassStructure(Element structure) {
- delegate.visitClassStructure(structure);
+ m_delegate.visitClassStructure(structure);
}
public void visitManipulatedResource(String type, byte[] resource) {
- delegate.visitManipulatedResource(type, resource);
+ m_delegate.visitManipulatedResource(type, resource);
}
public void visitEnd() {
- delegate.visitEnd();
+ m_delegate.visitEnd();
}
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/check/CheckFieldConsistencyResultVisitor.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/check/CheckFieldConsistencyResultVisitor.java
index 00d2055..008505c 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/check/CheckFieldConsistencyResultVisitor.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/check/CheckFieldConsistencyResultVisitor.java
@@ -38,23 +38,23 @@
/**
* Component's metadata.
*/
- private Element metadata;
+ private Element m_metadata;
/**
* Reporter for errors.
*/
- private Reporter reporter;
+ private Reporter m_reporter;
public CheckFieldConsistencyResultVisitor(ManipulationResultVisitor visitor) {
super(visitor);
}
public void setMetadata(Element metadata) {
- this.metadata = metadata;
+ this.m_metadata = metadata;
}
public void setReporter(Reporter reporter) {
- this.reporter = reporter;
+ this.m_reporter = reporter;
}
public void visitClassStructure(Element structure) {
@@ -63,7 +63,7 @@
collectStructuralFields(fieldsInStructure, structure);
List<String> fieldsInMetadata = new ArrayList<String>();
- Metadatas.findFields(fieldsInMetadata, metadata);
+ Metadatas.findFields(fieldsInMetadata, m_metadata);
checkReferredFieldsAreInStructure(fieldsInMetadata, fieldsInStructure);
@@ -94,8 +94,8 @@
// Then, try to find each referred field in the given field map
for (String fieldName : fieldsInMetadata) {
if (!fieldsInStructure.contains(fieldName)) {
- reporter.error("The field " + fieldName + " is referenced in the "
- + "metadata but does not exist in the " + Metadatas.getComponentType(metadata)
+ m_reporter.error("The field " + fieldName + " is referenced in the "
+ + "metadata but does not exist in the " + Metadatas.getComponentType(m_metadata)
+ " class");
}
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/check/CheckFieldConsistencyVisitor.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/check/CheckFieldConsistencyVisitor.java
index 149834a..5d3f635 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/check/CheckFieldConsistencyVisitor.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/check/CheckFieldConsistencyVisitor.java
@@ -32,20 +32,20 @@
*/
public class CheckFieldConsistencyVisitor extends ManipulationAdapter {
- private Reporter reporter;
+ private Reporter m_reporter;
public CheckFieldConsistencyVisitor(ManipulationVisitor visitor) {
super(visitor);
}
public void setReporter(Reporter reporter) {
- this.reporter = reporter;
+ this.m_reporter = reporter;
}
public ManipulationResultVisitor visitManipulationResult(Element metadata) {
CheckFieldConsistencyResultVisitor rv = new CheckFieldConsistencyResultVisitor(super.visitManipulationResult(metadata));
rv.setMetadata(metadata);
- rv.setReporter(reporter);
+ rv.setReporter(m_reporter);
return rv;
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/writer/ManipulatedResourcesWriter.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/writer/ManipulatedResourcesWriter.java
index d89eb00..de285c1 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/writer/ManipulatedResourcesWriter.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/writer/ManipulatedResourcesWriter.java
@@ -37,45 +37,45 @@
*/
public class ManipulatedResourcesWriter implements ManipulationVisitor {
- private ResourceStore resourceStore;
- private Reporter reporter;
- private List<ManipulatedResultWriter> writers;
+ private ResourceStore m_resourceStore;
+ private Reporter m_reporter;
+ private List<ManipulatedResultWriter> m_writers;
public ManipulatedResourcesWriter() {
- this.writers = new ArrayList<ManipulatedResultWriter>();
+ m_writers = new ArrayList<ManipulatedResultWriter>();
}
public void setResourceStore(ResourceStore resourceStore) {
- this.resourceStore = resourceStore;
+ m_resourceStore = resourceStore;
}
public void setReporter(Reporter reporter) {
- this.reporter = reporter;
+ m_reporter = reporter;
}
public ManipulationResultVisitor visitManipulationResult(Element metadata) {
- this.resourceStore.writeMetadata(metadata);
+ m_resourceStore.writeMetadata(metadata);
ManipulatedResultWriter writer = new ManipulatedResultWriter(metadata);
- writers.add(writer);
+ m_writers.add(writer);
return writer;
}
public void visitMetadata(Element metadata) {
- this.resourceStore.writeMetadata(metadata);
+ m_resourceStore.writeMetadata(metadata);
}
public void visitEnd() {
try {
- resourceStore.open();
- for (ManipulatedResultWriter writer : writers) {
+ m_resourceStore.open();
+ for (ManipulatedResultWriter writer : m_writers) {
for (Map.Entry<String, byte[]> entry : writer.getResources().entrySet()) {
- resourceStore.write(entry.getKey(), entry.getValue());
+ m_resourceStore.write(entry.getKey(), entry.getValue());
}
}
- resourceStore.close();
+ m_resourceStore.close();
} catch (IOException e) {
- reporter.error("Cannot store manipulation result: " + e.getMessage());
+ m_reporter.error("Cannot store manipulation result: " + e.getMessage());
}
}
}
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/writer/ManipulatedResultWriter.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/writer/ManipulatedResultWriter.java
index 5710969..b0619bd 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/writer/ManipulatedResultWriter.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/visitor/writer/ManipulatedResultWriter.java
@@ -32,22 +32,22 @@
*/
public class ManipulatedResultWriter implements ManipulationResultVisitor {
- private Map<String, byte[]> resources;
+ private Map<String, byte[]> m_resources;
- private Element component;
+ private Element m_component;
public ManipulatedResultWriter(Element component) {
- this.component = component;
- resources = new HashMap<String, byte[]>();
+ m_component = component;
+ m_resources = new HashMap<String, byte[]>();
}
public void visitClassStructure(Element structure) {
// Insert the manipulation structure in the component's metadata
- component.addElement(structure);
+ m_component.addElement(structure);
}
public void visitManipulatedResource(String type, byte[] resource) {
- this.resources.put(type, resource);
+ m_resources.put(type, resource);
}
public void visitEnd() {
@@ -55,6 +55,6 @@
}
public Map<String, byte[]> getResources() {
- return resources;
+ return m_resources;
}
}