|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdeveloper.compare.CompareMethod
public abstract class CompareMethod
Base class for a compare/merge method as registered through the CompareManager
. The function of a CompareMethod is to recognize an
invocation context, associate it with a CompareType
, and specify any
required fallback behavior if the compare (or merge) algorithm fails to
complete. Fallback might happen, for example, if an XML file contains a
corruption or is over the maximum comparable size.
Constructor Summary | |
---|---|
CompareMethod()
|
Method Summary | |
---|---|
abstract boolean |
canCompare(CompareContributor left,
CompareContributor right,
StreamType streamType)
Asks whether the given contributors, from the current context, can be compared. |
boolean |
canFallBack(CompareFailedException cfe)
Asks whether the fallback behavior should go ahead when the algorithm has failed with the given exception. |
boolean |
canMerge(CompareContributor left,
CompareContributor right,
CompareContributor ancestor)
Asks whether the given contributors, from the current context, can be merged. |
protected oracle.jdevimpl.compare.CompareOptions |
getCompareOptions()
Gets the CompareOptions instance from IDE preferences. |
abstract CompareType |
getCompareType()
Gets the CompareType associated with this CompareMethod |
CompareType[] |
getFallbackCompareTypes()
Gets the fallback compare types whose algorithms can be invoked if this CompareMethod fails. |
protected StreamType |
getStreamType(CompareContributor contributor)
Scans the stream for the given CompareContributor to yield
information about the type of the represented file. |
protected TextBuffer |
getTextBuffer(CompareContributor contributor)
Gets the text buffer for the given CompareContributor . |
void |
processOptions()
Process any options from the environment, prior to invoking the compare/merge algorithm. |
boolean |
recognizeContent(java.net.URL url)
|
protected java.lang.String |
scanForXMLNamespaceURI(TextBuffer textBuffer,
java.lang.String name)
Scans the given buffer for an XML root element's namespace URI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompareMethod()
Method Detail |
---|
public boolean recognizeContent(java.net.URL url)
public abstract boolean canCompare(CompareContributor left, CompareContributor right, StreamType streamType)
Note that this method is performance-critical and must do a minumum of work to recognize the context, E.g. by scanning files rather than parsing them in their entirety.
left
- the left-hand side contributor.right
- the right-hand side contributor.streamType
- the StreamType
, if available. (null-capable)
CompareType
can compare the given contributors.public boolean canMerge(CompareContributor left, CompareContributor right, CompareContributor ancestor)
Note that this method is performance-critical and must do a minumum of work to recognize the context, E.g. by scanning files rather than parsing them in their entirety.
left
- the left-hand side contributor.right
- the right-hand side contributor.ancestor
- the common ancestor contributor.
CompareType
can merge the given contributors.public abstract CompareType getCompareType()
CompareType
associated with this CompareMethod
CompareType
.public void processOptions()
public boolean canFallBack(CompareFailedException cfe)
cfe
- the failure.
public CompareType[] getFallbackCompareTypes()
CompareType
will be chosen for fallback; this will be the first type with
a registered algorithm. Returning multiple types gives the framework an
alternative for when an algorithm is not available because, for example,
its product extension is not loaded.
protected final StreamType getStreamType(CompareContributor contributor)
CompareContributor
to yield
information about the type of the represented file.
contributor
- the CompareContributor
.
StreamType
.protected final TextBuffer getTextBuffer(CompareContributor contributor)
CompareContributor
. This will
not be accessible for certain contributor types (E.g. those representing
directories).
contributor
- the CompareContributor
.
TextBuffer
. (null-capable)protected final java.lang.String scanForXMLNamespaceURI(TextBuffer textBuffer, java.lang.String name)
textBuffer
- the TextBuffer
to scan.name
- the namespace name, or null for the default namespace.
protected final oracle.jdevimpl.compare.CompareOptions getCompareOptions()
CompareOptions
instance from IDE preferences.
CompareOptions
.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |