|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspark.data.io.TypeFactoryReflect
public class TypeFactoryReflect
This type factory uses reflection to create SOs that are subclasses of SOReflect. This way objects of various Java classes can be read and written with the class information correctly handled in the external form.
This TypeFactory can restrict objects to come only from a specified list of packages. The goal here is to simplify the type names so they do not need to be fully qualified and also to restrict the kinds of objects that can be created. This prevents a rather simple form of attack whereby an arbitrary object can be generated and then start taking action within the program.
Arrays are still created as SArrays.
Constructor Summary | |
---|---|
TypeFactoryReflect(java.lang.String[] packages)
This will construct a new TypeFactoryReflect object. |
Method Summary | |
---|---|
java.lang.String |
externalTypeName(SO obj)
This will return the externalTypeName to be used to represent the object externally. |
SA |
makeArray()
SAs are not typed generally. |
SO |
makeObject(java.lang.String externalTypeName)
Given an external type name this will create an SO of the correct internal type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TypeFactoryReflect(java.lang.String[] packages)
packages
- these are the only packages from which objects
can be generated. Each package must be explicitly named even if it is
a subpackage of a package that is already included.
If this is null then this will create any object for which there is
a fully qualified name that is assignable to SO.Method Detail |
---|
public SO makeObject(java.lang.String externalTypeName)
TypeFactory
makeObject
in interface TypeFactory
externalTypeName
- the name used in the external representation
for an object type.
public SA makeArray()
TypeFactory
makeArray
in interface TypeFactory
public java.lang.String externalTypeName(SO obj)
TypeFactory
externalTypeName
in interface TypeFactory
obj
- the object whose type is to be represented.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |