|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.orion.sdata.servlet.accpac.SDataViewSet
public class SDataViewSet
The SDataViewSet
class provides the collection of related
SDataView
s. All of the SDataView
s in a set are related
to each other. Keeping track of the views as a collection allows us to keep
track of neighbor views etc.
Subclass this class to provide an application-specific version. This allows
you to override the createView(String, Resource)
method so you can
create instances of application-specific subclasses of the contained
SDataView
class. You may also override the
createSchemaChange()
method if you need to include additional
attribute view notifications
For example:
class MySDataViewSet extends SDataViewSet { protected SDataView createView(String rid, Resource resource) { return "MY9876".equalsIgnoreCase(rid) ? new My9876View(this, rid, resource) : new SDataView(this, rid, resource); } }You may also override the
onDispose()
method to perform any clean-up
required when the class is disposed of.
If the subclass includes public methods use checkUndisposed()
and
ensureViewsLoaded()
to check the state of the superclass.
Constructor Summary | |
---|---|
protected |
SDataViewSet(com.sage.accpac.sm.Program program,
Resource resource)
creates a new instance of the SDataViewSet class. |
Method Summary | |
---|---|
protected void |
checkUndisposed()
checks that dispose() has not yet been called, throwing a
suitable exception if it has. |
protected SchemaChange |
createSchemaChange()
creates an instance of the SchemaChange class. |
protected SDataView |
createView(java.lang.String rotoid,
Resource resource)
creates an instance of the given SDataView . |
protected void |
dispose()
dispose of anything now that the instance is no longer needed. |
protected void |
ensureViewsLoaded()
Ensure that views have actually been loaded, allowing for delayed loading. |
SDataView |
get(java.lang.String id)
Gets the SDataView with the given roto id from the list of all
views. |
boolean |
getMaintainRecordNumbers()
gets whether the views in the set should consider maintaining record numbers. |
com.sage.accpac.sm.Program |
getProgram()
gets the Program of the set. |
Resource |
getResource(SDataView view)
returns the Resource corresponding to the SDataView given. |
SDataView |
getView(Resource res)
returns the SDataView corresponding to the Resource given. |
java.util.Set<SDataView> |
getViews()
returns the views in the set. |
protected void |
onDispose()
override this method to perform any cleanup that is required during the dispose() operation. |
void |
setMaintainRecordNumbers(boolean maintainRecordNumbers)
sets the value to be returned by getMaintainRecordNumbers() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SDataViewSet(com.sage.accpac.sm.Program program, Resource resource)
Call dispose()
when finished.
program
- the Program
supporting the ViewSetresource
- the Resource
at the top of the ViewSetMethod Detail |
---|
protected void onDispose()
dispose()
operation. This will be called before the views
themselves are disposed. Even if dispose
is called more than
once this will only be called on the first occasion.
protected final void dispose()
onDispose()
before disposing of the views.
Do not use the instance after calling this.
public final com.sage.accpac.sm.Program getProgram()
Program
of the set. This is the one that was provided
when the set was constructed.
Program
that was provided to the constructorpublic final SDataView getView(Resource res)
SDataView
corresponding to the Resource
given.
res
- the Resource
public java.util.Set<SDataView> getViews()
get(String)
getView(Resource)
getResource(SDataView)
public final Resource getResource(SDataView view)
Resource
corresponding to the SDataView
given.
view
- the SDataView
whose resource is required.
Resource
corresponding to the SDataView
given.public final SDataView get(java.lang.String id)
SDataView
with the given roto id from the list of all
views.
This operates off the list returned by getViews()
and so can find
views being maintained by the subclass.
id
- the roto id of the view
protected final void ensureViewsLoaded()
protected SDataView createView(java.lang.String rotoid, Resource resource)
SDataView
. Override this method
to create subclasses with application-specific behavior.
rotoid
- the roto ID of the view to be created, in upper-caseresource
- the resource that corresponds to it
protected SchemaChange createSchemaChange()
SchemaChange
class. That will be used
to accumulate changes to the attributes of the set during a set of view
operations.
Override this method to provide an application-specific subclass.
SchemaChange
. Do not return null;
throw an exception on failure.protected final void checkUndisposed()
dispose()
has not yet been called, throwing a
suitable exception if it has. This should be called by all public methods,
even in subclasses. However it is not needed for protected methods.
java.lang.NullPointerException
- if dispose
has already been calledpublic final boolean getMaintainRecordNumbers()
This is an immutable property of this instance of the class.
true
if, and only if, the views in the view set should
consider maintaining record numberspublic final void setMaintainRecordNumbers(boolean maintainRecordNumbers)
getMaintainRecordNumbers()
.
If called, this must be called before getMaintainRecordNumbers()
can be called.
If not called, false
will be assumed.
maintainRecordNumbers
- the value to be returned by getMaintainRecordNumbers()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |