|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.caching.util.SimpleFeatureMarshaller
public class SimpleFeatureMarshaller
Simple marshaller that can write features to an ObjectOutputStream. Feature is not Serializable, but this is based on the idea that most attributes object are Serializable (JTS geometries are Serializable), and that attributes which are not simple, are either a collection we can iterate through, or another Feature. Serialization is then achieved recursively. Unmarshalling implies to know the FeatureType of the marshalled feature. Storage format : Header, Attributes Header := int : FeatureType hashCode, String : FeatureType name, String : Feature ID, int : number of attributes Attributes := [Attribute] Attribute := int : multiplicity, or O if simple, or -1 if FeatureAttribute, Object|Feature|[Attribute] : attribute value This implementation does not have the ambition of being robust.
Field Summary | |
---|---|
static int |
FEATURE
marker to indicate an attribute is a feature in the serialized form |
static int |
SIMPLEATTRIBUTE
|
Constructor Summary | |
---|---|
SimpleFeatureMarshaller()
Default constructor. |
Method Summary | |
---|---|
void |
marshall(org.opengis.feature.simple.SimpleFeature f,
java.io.ObjectOutput s)
Marshall a feature into a stream. |
protected void |
marshallSimpleAttribute(java.lang.Object o,
java.io.ObjectOutput s)
Marshall an attribute into a stream. |
void |
registerType(org.opengis.feature.simple.SimpleFeatureType type)
Registers a type with the feature marshaller |
org.opengis.feature.simple.SimpleFeature |
unmarshall(java.io.ObjectInput s)
Inverse operation of marshall : read a feature from a stream. |
protected org.opengis.feature.simple.SimpleFeature |
unmarshall(java.io.ObjectInput s,
org.opengis.feature.simple.SimpleFeatureType type)
Inverse operation of marshall : read a feature from a stream. |
protected java.lang.Object |
unmarshallSimpleAttribute(java.io.ObjectInput s)
Read attribute values from a stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FEATURE
public static final int SIMPLEATTRIBUTE
Constructor Detail |
---|
public SimpleFeatureMarshaller()
Method Detail |
---|
public void registerType(org.opengis.feature.simple.SimpleFeatureType type)
type
- public void marshall(org.opengis.feature.simple.SimpleFeature f, java.io.ObjectOutput s) throws java.io.IOException
f
- the Feature to marshalls
- the stream to write to
java.io.IOException
protected void marshallSimpleAttribute(java.lang.Object o, java.io.ObjectOutput s) throws java.io.IOException
o
- an attribute value which is Serializable, or a feature, or a collections
- the stream to write to
java.io.IOException
public org.opengis.feature.simple.SimpleFeature unmarshall(java.io.ObjectInput s) throws java.io.IOException, java.lang.ClassNotFoundException, org.opengis.feature.IllegalAttributeException
s
- the stream to read from
java.io.IOException
java.lang.ClassNotFoundException
org.opengis.feature.IllegalAttributeException
protected org.opengis.feature.simple.SimpleFeature unmarshall(java.io.ObjectInput s, org.opengis.feature.simple.SimpleFeatureType type) throws java.io.IOException, java.lang.ClassNotFoundException, org.opengis.feature.IllegalAttributeException
s
- the stream to read fromthe
- type of the feature to unmarshall
java.io.IOException
java.lang.ClassNotFoundException
org.opengis.feature.IllegalAttributeException
protected java.lang.Object unmarshallSimpleAttribute(java.io.ObjectInput s) throws java.io.IOException, java.lang.ClassNotFoundException, org.opengis.feature.IllegalAttributeException
s
- the stream to read from
java.io.IOException
java.lang.ClassNotFoundException
org.opengis.feature.IllegalAttributeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |