public class DefaultAuditModel extends AbstractAuditModel implements AuditListener
AuditListener and is typically populated by attaching it as a
listener to an Auditor. The auditor events will always arrive on the
auditor thread; typically clients will either be synchronous or
asynchronous.
A synchronous client waits for the auditor to finish running to access the
model; the client thread is either the auditor thread, or another
thread that has synchronized with the auditor thread when the audit stops.
An asynchronous client accesses the model from the event thread while the
auditor is running on the (different) auditor thread; the client
thread is then the event thread.
The model determines whether to operate synchronously or asynchronously
based on the current thread when the auditStarted event is delivered, and
whether the IDE is running in headless mode.AuditModel,
AuditModelListenerAuditModel.Count| Constructor and Description |
|---|
DefaultAuditModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(AuditModelFilter filter)
Adds a filter to this model.
|
void |
auditorCleared(Auditor auditor)
Reports an auditor cleared event.
|
void |
auditStarted(Auditor auditor,
java.util.List<Metric> columns,
java.util.List<Location> locations,
Location root,
java.lang.Class type)
Reports an Auditor audit started event.
|
void |
auditStopped(Auditor auditor,
boolean cancelled)
Reports an Auditor audit stopped event.
|
void |
clear()
Clears all rows from the model.
|
oracle.jdevimpl.audit.core.DefaultAuditModel.Row |
createDummyRow(AuditModel model,
java.lang.Object row) |
<T extends AuditModelFilter> |
findFilter(java.lang.Class<T> type)
Finds a filter of this model of a specified type.
|
java.util.Comparator<java.lang.Object> |
getChildComparator()
Gets the comparator used to sort the children of row of this model.
|
int |
getChildCount(java.lang.Object row)
Gets the number of children of a row of this model.
|
java.util.List<?> |
getChildren(java.lang.Object row)
Gets the children of a row of this model.
|
Metric |
getColumn(int index)
Gets the column at an index.
|
int |
getColumnCount()
Gets the number of columns in this model.
|
int |
getColumnIndex(Metric column)
Gets the index of a column.
|
int |
getCount(java.lang.Object row,
AuditModel.Count count)
Gets the value of a
count of a row of this model. |
Location |
getFocusLocation(java.lang.Object row)
Gets the focus
Location of an object represented by a row in this
model. |
javax.swing.Icon |
getIcon(java.lang.Object row)
Gets the icon for a row of this model.
|
int |
getIndexOf(java.lang.Object row)
Gets the index of a row of this model in the children of its parent, 0
for the root row.
|
java.lang.String |
getLabel(java.lang.Object row)
Gets the label for a row of this model.
|
Location |
getLocation(java.lang.Object row)
Gets the
Location of an object represented by a row of this model. |
java.util.List<Location> |
getLocations()
Gets the locations audited to create this model.
|
java.lang.Object |
getParent(java.lang.Object row)
Gets the parent row of a row of this model, null for the root row.
|
Profile |
getProfile()
Gets the profile used to create this model.
|
java.lang.Object |
getRoot()
Gets the root row of this model, null if none.
|
Severity |
getSeverity(java.lang.Object row)
Gets the worst severity of the issues contained by a row of this model,
or null if none.
|
int |
getSortColumn()
Gets the selected primary sort column.
|
int |
getSortDirection()
Gets the sort direction of the primary sort column, 1 for ascending, -1
for descending.
|
java.lang.String |
getSummary(java.lang.Object row)
Gets the summary for a row of this model.
|
java.util.List<Transform> |
getTransformsApplied(Violation violation)
Gets the transforms applied to a violation of this model, in application
order.
|
java.lang.Class |
getType(java.lang.Object row)
Gets the type of an object of this model.
|
java.lang.Object |
getValue(java.lang.Object row,
int columnIndex)
Gets the value of a column of a row of this model.
|
Violation |
getViolation(java.lang.Object row)
Gets the violation represented by a row of this model, or null if the
row does not represent a violation.
|
int |
getVisibleChildCount(java.lang.Object row)
Gets the number of visible children of a row of this model.
|
java.util.List<?> |
getVisibleChildren(java.lang.Object row)
Gets the visible children of a row of this model.
|
int |
getVisibleIndexOf(java.lang.Object row)
Gets the index of a row of this model in the visible children of its
visible parent, 0 for the root row.
|
java.lang.Object |
getVisibleParent(java.lang.Object row)
Gets the visible parent row of a row of this model, null for the root row.
|
boolean |
hasChildren(java.lang.Object row)
Gets whether a row of this model has children.
|
boolean |
hasVisibleChildren(java.lang.Object row)
Gets whether a row of this model has visible children.
|
boolean |
isLeaf(java.lang.Object row)
Gets whether a row of this model ,i>can have children.
|
boolean |
isOutOfBand(java.lang.Object row)
Gets whether the value of any column of a row of this model is out-of-band.
|
boolean |
isOutOfBand(java.lang.Object row,
int columnIndex)
Gets whether the value of a column of a row of this model is out-of-band.
|
void |
issueReported(Auditor auditor,
Violation issue,
int transformMask)
Reports an Auditor violation reported event.
|
boolean |
isViolation(java.lang.Object row)
Gets whether the object represented by a row of this model is a violation.
|
boolean |
isVisible(java.lang.Object row)
Gets whether a row of this model is visible.
|
java.lang.Object |
iterateChildren(java.lang.Object row,
Iteration iteration)
Iterates the children of a row of this model.
|
Violation |
iterateViolations(java.lang.Object row,
Iteration iteration)
Iterates the violations contained by a row of this model.
|
void |
locationEntered(Auditor auditor,
Location location,
java.lang.Class type)
Reports an Auditor location entered event.
|
void |
locationExited(Auditor auditor,
Location location)
Reports an Auditor location exited event.
|
void |
modelEntered(Auditor auditor,
ModelAdapter model)
Reports an Auditor model entered event.
|
void |
modelExited(Auditor auditor,
ModelAdapter model)
Reports an Auditor model exited event.
|
void |
phaseStarted(Auditor auditor,
java.lang.String phaseName)
Reports an Auditor phase started event.
|
void |
removeFilter(AuditModelFilter filter)
Removes a filter from this model.
|
void |
setSortColumn(int column)
Sets the primary sort column for children of a row of this model, or null
to sort by
AuditModel.getLocation(java.lang.Object). |
void |
setTransformDone(Transform transform,
Violation violation)
Sets a transform done for a violation of this model.
|
void |
setTransformUndone(Transform transform,
Violation violation)
Sets a transform undone for a violation of this model.
|
void |
setValue(java.lang.Object row,
int columnIndex,
java.lang.Object value)
Sets the value of an column of a row of this model.
|
java.lang.String |
toString() |
void |
valueReported(Auditor auditor,
Location location,
Metric metric,
java.lang.Object newValue)
Reports an Auditor value reported event.
|
addAuditModelListener, fireAppliedTransformsChanged, fireAuditStarted, fireAuditStopped, fireCountChanged, fireModelResorted, fireRowsHidden, fireRowsInserted, fireRowsRemoved, fireRowsRestructureBegin, fireRowsRestructureEnd, fireRowsShown, fireValueChanged, removeAuditModelListenerpublic Profile getProfile()
AuditModelgetProfile in interface AuditModelpublic java.util.List<Location> getLocations()
AuditModelgetLocations in interface AuditModelpublic int getColumnCount()
AuditModelgetColumnCount in interface AuditModelpublic Metric getColumn(int index)
AuditModelgetColumn in interface AuditModelpublic int getColumnIndex(Metric column)
AuditModelgetColumnIndex in interface AuditModelpublic void setSortColumn(int column)
AuditModelAuditModel.getLocation(java.lang.Object). If the specified column is already the
primary sort column, toggles the sort direction.setSortColumn in interface AuditModelpublic int getSortColumn()
AuditModelgetSortColumn in interface AuditModelpublic int getSortDirection()
AuditModelgetSortDirection in interface AuditModelpublic void clear()
AuditModelclear in interface AuditModelpublic java.lang.Object getRoot()
AuditModelgetRoot in interface AuditModelpublic java.lang.Object getParent(java.lang.Object row)
AuditModelgetParent in interface AuditModelpublic int getIndexOf(java.lang.Object row)
AuditModelgetIndexOf in interface AuditModelpublic boolean isLeaf(java.lang.Object row)
AuditModelisLeaf in interface AuditModelpublic boolean hasChildren(java.lang.Object row)
AuditModelhasChildren in interface AuditModelpublic int getChildCount(java.lang.Object row)
AuditModelgetChildCount in interface AuditModelpublic java.util.List<?> getChildren(java.lang.Object row)
AuditModelgetChildren in interface AuditModelpublic java.util.Comparator<java.lang.Object> getChildComparator()
AuditModel
The order reflects invocations of AuditModel.setSortColumn(int).
getChildComparator in interface AuditModelpublic boolean isVisible(java.lang.Object row)
AuditModelisVisible in interface AuditModelpublic void addFilter(AuditModelFilter filter)
AuditModelFilter.isVisible(java.lang.Object).addFilter in interface AuditModelpublic void removeFilter(AuditModelFilter filter)
removeFilter in interface AuditModelpublic <T extends AuditModelFilter> T findFilter(java.lang.Class<T> type)
findFilter in interface AuditModelpublic java.lang.Object getVisibleParent(java.lang.Object row)
AuditModelgetVisibleParent in interface AuditModelpublic int getVisibleIndexOf(java.lang.Object row)
AuditModelgetVisibleIndexOf in interface AuditModelpublic boolean hasVisibleChildren(java.lang.Object row)
AuditModelhasVisibleChildren in interface AuditModelpublic int getVisibleChildCount(java.lang.Object row)
AuditModelgetVisibleChildCount in interface AuditModelpublic java.util.List<?> getVisibleChildren(java.lang.Object row)
AuditModelgetVisibleChildren in interface AuditModelpublic java.lang.Object iterateChildren(java.lang.Object row,
Iteration iteration)
AuditModeliterateChildren in interface AuditModelpublic Violation iterateViolations(java.lang.Object row, Iteration iteration)
AuditModeliterateViolations in interface AuditModelpublic Location getLocation(java.lang.Object row)
AuditModelLocation of an object represented by a row of this model.getLocation in interface AuditModelpublic Location getFocusLocation(java.lang.Object row)
AuditModelLocation of an object represented by a row in this
model.getFocusLocation in interface AuditModelpublic boolean isViolation(java.lang.Object row)
AuditModelisViolation in interface AuditModelpublic Violation getViolation(java.lang.Object row)
AuditModelgetViolation in interface AuditModelpublic java.lang.Class getType(java.lang.Object row)
AuditModel
getLocation(row).getModel().getType().getPresentationTypes()
If the object is a violation, the type is Violation.getType in interface AuditModelModelType.getPresentationTypes()public java.lang.String getLabel(java.lang.Object row)
AuditModelgetLabel in interface AuditModelpublic java.lang.String getSummary(java.lang.Object row)
AuditModelgetSummary in interface AuditModelpublic javax.swing.Icon getIcon(java.lang.Object row)
AuditModelgetIcon in interface AuditModelpublic java.lang.Object getValue(java.lang.Object row,
int columnIndex)
AuditModelgetValue in interface AuditModelpublic void setValue(java.lang.Object row,
int columnIndex,
java.lang.Object value)
AuditModelsetValue in interface AuditModelpublic int getCount(java.lang.Object row,
AuditModel.Count count)
AuditModelcount of a row of this model.getCount in interface AuditModelpublic Severity getSeverity(java.lang.Object row)
AuditModelgetSeverity in interface AuditModelpublic boolean isOutOfBand(java.lang.Object row,
int columnIndex)
AuditModelisOutOfBand in interface AuditModelpublic boolean isOutOfBand(java.lang.Object row)
AuditModelisOutOfBand in interface AuditModelpublic java.util.List<Transform> getTransformsApplied(Violation violation)
AuditModelgetTransformsApplied in interface AuditModelpublic void setTransformDone(Transform transform, Violation violation)
AuditModelsetTransformDone in interface AuditModelpublic void setTransformUndone(Transform transform, Violation violation)
AuditModelsetTransformUndone in interface AuditModelpublic void auditStarted(Auditor auditor, java.util.List<Metric> columns, java.util.List<Location> locations, Location root, java.lang.Class type)
AuditListenerauditStarted in interface AuditListenerpublic void modelEntered(Auditor auditor, ModelAdapter model)
AuditListenermodelEntered in interface AuditListenerpublic void modelExited(Auditor auditor, ModelAdapter model)
AuditListenermodelExited in interface AuditListenerpublic void locationEntered(Auditor auditor, Location location, java.lang.Class type)
AuditListenerlocationEntered in interface AuditListenerpublic void locationExited(Auditor auditor, Location location)
AuditListenerlocationExited in interface AuditListenerpublic void issueReported(Auditor auditor, Violation issue, int transformMask)
AuditListenerissueReported in interface AuditListenerpublic void valueReported(Auditor auditor, Location location, Metric metric, java.lang.Object newValue)
AuditListenervalueReported in interface AuditListenerpublic void phaseStarted(Auditor auditor, java.lang.String phaseName)
AuditListenerphaseStarted in interface AuditListenerpublic void auditStopped(Auditor auditor, boolean cancelled)
AuditListenerauditStopped in interface AuditListenerpublic void auditorCleared(Auditor auditor)
AuditListenerauditorCleared in interface AuditListenerpublic oracle.jdevimpl.audit.core.DefaultAuditModel.Row createDummyRow(AuditModel model, java.lang.Object row)
public java.lang.String toString()
toString in class java.lang.Object