01: package org.geotools.xml;
02:
03: import java.util.List;
04:
05: import org.eclipse.xsd.XSDElementDeclaration;
06:
07: /**
08: * Factory used by the encoder to obtain child values from objects being encoded.
09: *
10: * @author Justin Deoliveira, The Open Planning Project
11: *
12: */
13: public interface PropertyExtractor {
14:
15: /**
16: * Determines if this extractor can handle objects of the given type.
17: *
18: * @param object The object being encoded.
19: *
20: * @return <code>true</code> if the extractor can handle the object,
21: * otherwise <code>false<code>.
22: */
23: boolean canHandle(Object object);
24:
25: /**
26: * Exracts the properties from the object being encoded.
27: * <p>
28: * This method should return a set of tuples made up of
29: * ({@link org.eclipse.xsd.XSDParticle},Object).
30: * </p>
31: *
32: * @param object The object being encoded.
33: * @param element The element declaration corresponding to the object being encoded.
34: *
35: * @return A set of element, object tuples.
36: */
37: List/*Object[2]*/properties(Object object,
38: XSDElementDeclaration element);
39:
40: }
|