org.sandev.basics.util
Interface Resolvable

All Known Implementing Classes:
AggregateUpdate, AuthorizerNodeInstance, AuthWrapper, BaseUser, BaseUserEmail, CacheAction, CacheItemSummary, CacheManagerNodeInstance, CacheMemSummary, CacheStats, Configuration, DataImportExport, DataManagerNodeInstance, ErrorInfo, IODeclBase, IODeclCall, IODeclReceive, IODeclSend, IODeclSubscribe, MessageDescription, MessageDriverNodeInstance, Ping, ServerDeclaration, Stats, StringValue, TestAction, TestCondition, TestNodeParamChange, TestRunStatus, TestScript, TestStep, UIDisplayDirective, UIFormContext, UIFormControl, UIFormInitializer, UIFormQuery

public interface Resolvable

Interface indicating reference fields within this object can be resolved. Implemented by SandInstanceMessages for use as part of inter-field validation and reference field access. This interface relies on interfaces outside of structs and messages, which is why it is in this package and not in org.sandev.basics.structs.


Method Summary
 java.lang.String[] getDisplayValues(IDLookup lookup, AuthUser user, java.lang.String defaultVal)
          Returns the values corresponding to the declared display fields, or the defaultVal if the display value cannot be retrieved for any reason.
 java.lang.String[] referenceValidate(java.lang.String[] locations, java.lang.String prefix, IDLookup idlookup, NameLookup namelookup, AuthUser user)
          Return a collection of unresolved reference locations.
 

Method Detail

referenceValidate

java.lang.String[] referenceValidate(java.lang.String[] locations,
                                     java.lang.String prefix,
                                     IDLookup idlookup,
                                     NameLookup namelookup,
                                     AuthUser user)
                                     throws SandException
Return a collection of unresolved reference locations. If there are no unresolved references, then this method returns the String[] passed in. This method checks any reference fields within this object, and calls referenceValidate on any contained objects.

A location is the field name (eg myField), followed by an array index if this is an array (eg myField[2]). The location is prefixed to create the return value. When calling referenceValidate for a contained object, pass the the current location, followed by a dot, as the prefix. This produces readable and parseable output for each reference problem location.

This method throws a SandException since use of the lookups can throw just about anything depending on their processing.

Throws:
SandException

getDisplayValues

java.lang.String[] getDisplayValues(IDLookup lookup,
                                    AuthUser user,
                                    java.lang.String defaultVal)
Returns the values corresponding to the declared display fields, or the defaultVal if the display value cannot be retrieved for any reason. The IDLookup and AuthUser are required only if the summary description contains dereferencing expressions (eg "refField.refValue").