|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Inspector
Common interface implemented by all Inspectors. Inspectors decouple the process of generating inspection results out of back-end metadata.
Inspectors must be immutable (or, at least, appear that way to clients. They can have caches or configuration settings internally, as long as they are threadsafe).
This interface is designed to work for the majority of use cases, but not every
use case. Inevitably there are tradeoffs. For example, the toInspect parameter is
redundant for XML-based Inspectors (note, however, that the type parameter is
not redundant for Object-based Inspectors).
In particular, this interface does not pass an M metawidget or any other kind of
'helper context' as the other interfaces do. This is because Inspectors are meant to exist independent
of any particular UI framework. Indeed, they can exist on back-end tiers where no UI framework is
available at all. This seems to work for most use cases encountered so far. Theoretically, though, if you
find yourself needing access to a context, consider:
JspAnnotationInspector does this); orObject[] containing the object to be inspected and the context to toInspect, and
build something like CompositeInspector to strip that context back out before calling the regular Inspectors; orInspectionResultProcessor.

| Method Summary | |
|---|---|
java.lang.String |
inspect(java.lang.Object toInspect,
java.lang.String type,
java.lang.String... names)
Inspect the given Object according to the given path, and return the result as a String conforming to inspection-result-1.0.xsd. |
| Method Detail |
|---|
java.lang.String inspect(java.lang.Object toInspect,
java.lang.String type,
java.lang.String... names)
Note: the method returns a String, rather than a DOM, to support the use of hetergenous technologies between the Inspectors and the Metawidgets. For example, GwtMetawidget is written in JavaScript but its Inspectors are written in Java.
toInspect - runtime object to inspect. May be nulltype - match type attribute in inspection-result.xmlnames - match name attributes under type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||