提交 dc4f999e authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting, javadocs

上级 0dae0b0b
......@@ -56,7 +56,7 @@ import org.h2.value.ValueUuid;
/**
* This class represents a byte buffer that contains persistent data of a page.
*
*
* @author Thomas Mueller
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......
......@@ -19,7 +19,7 @@ import java.util.Properties;
* is unloaded when stopping the bundle.
*/
public class DbDriverActivator implements BundleActivator {
private OSGIClassFactory osgiClassFactory;
private OSGIServiceClassFactory osgiServiceClassFactory;
......@@ -47,7 +47,7 @@ public class DbDriverActivator implements BundleActivator {
* Stop the bundle. This will unload the database driver. The
* DataSourceFactory service is implicitly un-registered by the OSGi
* framework.
*
*
* @param bundleContext the bundle context
*/
@Override
......@@ -65,7 +65,7 @@ public class DbDriverActivator implements BundleActivator {
* BundleSymbolicName:BundleVersion:BinaryClassName
*/
private static class OSGIClassFactory implements Utils.ClassFactory {
/**
* Separator character to merge bundle name,version and class binary
* name
......@@ -78,7 +78,7 @@ public class DbDriverActivator implements BundleActivator {
/**
* Constructor
*
*
* @param bundleContext Valid bundleContext instance
*/
OSGIClassFactory(BundleContext bundleContext) {
......@@ -114,21 +114,23 @@ public class DbDriverActivator implements BundleActivator {
+ parts[BUNDLE_VERSION_INDEX]);
}
}
/**
* Extend the H2 class loading in order to find class defined in other bundles.
* Extend the H2 class loading in order to find class defined in other
* bundles.
*
* The Class must be registered as a service.
* The class must be registered as a service.
*
* The main difference with {@link OSGIClassFactory} is that it does not rely to a specific bundle.
* OSGIServiceClassFactory is the preferred way to register function used in table constraints,
* theses functions should not be removed of the DataBase.
* The main difference with {@link OSGIClassFactory} is that it does not
* rely to a specific bundle. OSGIServiceClassFactory is the preferred way
* to register function used in table constraints, these functions should
* not be removed from the database.
*
* The class format for bundle service class is the following :
* The class format for bundle service class is the following:
* OSGI:BinaryClassNameService
*/
private static class OSGIServiceClassFactory implements Utils.ClassFactory {
/**
* Separator character to merge bundle name, version and class binary
* name
......@@ -136,7 +138,7 @@ public class DbDriverActivator implements BundleActivator {
public static final String SEPARATOR = "=";
private static final int BINARY_CLASS_NAME_INDEX = 1;
private BundleContext bundleContext;
/**
......@@ -168,5 +170,5 @@ public class DbDriverActivator implements BundleActivator {
throw new ClassNotFoundException("OSGi Service not found "+parts[BINARY_CLASS_NAME_INDEX]);
}
}
}
......@@ -62,12 +62,12 @@ public class Utils {
private static boolean allowAllClasses;
private static HashSet<String> allowedClassNames;
/**
* In order to manage more than one class loader
*/
private static ArrayList<ClassFactory> userClassFactories = new ArrayList<ClassFactory>();
private static String[] allowedClassNamePrefixes;
static {
......@@ -80,14 +80,14 @@ public class Utils {
}
}
}
private Utils() {
// utility class
}
/**
* Add a class factory in order to manage more than one class loader.
*
*
* @param classFactory An object that implements ClassFactory
*/
public static void addClassFactory(ClassFactory classFactory) {
......@@ -96,13 +96,13 @@ public class Utils {
/**
* Remove a class factory
*
*
* @param classFactory Already inserted class factory instance
*/
public static void removeClassFactory(ClassFactory classFactory) {
getUserClassFactories().remove(classFactory);
}
private static ArrayList<ClassFactory> getUserClassFactories() {
if (userClassFactories == null) {
// initially, it is empty
......@@ -111,7 +111,7 @@ public class Utils {
}
return userClassFactories;
}
private static int readInt(byte[] buff, int pos) {
return (buff[pos++] << 24) + ((buff[pos++] & 0xff) << 16) + ((buff[pos++] & 0xff) << 8) + (buff[pos] & 0xff);
}
......@@ -920,19 +920,19 @@ public class Utils {
* in order to provide a class from another bundle ClassLoader.
*/
public interface ClassFactory {
/**
* Check whether the factory can return the named class.
*
*
* @param name the binary name of the class
* @return true if this factory can return a valid class for the
* provided class name
*/
boolean match(String name);
/**
* Load the class.
*
*
* @param name the binary name of the class
* @return the class object
* @throws ClassNotFoundException If the class is not handle by this
......
......@@ -963,7 +963,7 @@ public class DataType {
/**
* Check whether a given object is a Geometry object.
*
*
* @param x the the object
* @return true if it is a Geometry object
*/
......
......@@ -34,7 +34,7 @@ import org.h2.util.Utils;
/**
* This is the base class for all value classes.
* It provides conversion and comparison methods.
*
*
* @author Thomas Mueller
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......
......@@ -22,7 +22,7 @@ import com.vividsolutions.jts.io.WKTWriter;
/**
* Implementation of the GEOMETRY data type.
*
*
* @author Thomas Mueller
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......@@ -79,18 +79,18 @@ public class ValueGeometry extends Value {
/**
* Test if this geometry envelope intersects with the other geometry
* envelope.
*
*
* @param r the other geometry
* @return true if the two envelopes overlaps
* @return true if the two overlap
*/
public boolean intersectsBoundingBox(ValueGeometry r) {
// it is useless to cache the envelope as the Geometry object do this already
// the Geometry object caches the envelope
return geometry.getEnvelopeInternal().intersects(r.getGeometry().getEnvelopeInternal());
}
/**
* Get the union.
*
*
* @param r the other geometry
* @return the union of this geometry envelope and another geometry envelope
*/
......@@ -99,13 +99,13 @@ public class ValueGeometry extends Value {
Envelope mergedEnvelope = new Envelope(geometry.getEnvelopeInternal());
mergedEnvelope.expandToInclude(r.getGeometry().getEnvelopeInternal());
return get(gf.toGeometry(mergedEnvelope));
}
}
/**
* Get the intersection.
*
*
* @param r the other geometry
* @return the intersection of this geometry envelope and another geometry envelope
* @return the intersection of this geometry envelope and another
*/
public ValueGeometry getEnvelopeIntersection(ValueGeometry r) {
Envelope e1 = geometry.getEnvelopeInternal();
......@@ -120,7 +120,7 @@ public class ValueGeometry extends Value {
GeometryFactory gf = new GeometryFactory();
return get(gf.toGeometry(e3));
}
@Override
public int getType() {
return Value.GEOMETRY;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论