signature:
public class PropertyUpdate { /** * Returns an < code > Enumeration < / code > over this propertyupdate ' s set
 * and remove property elements .
 * @ return an < code > Enumeration < / code > of
 * < code > PropertyUpdate . Directive < / code > s
 * @ throws MalformedElementException if there is reason to believe that
 * this editor ' s underlying element is not well formed */
public Enumeration getSetsAndRemoves ( ) throws MalformedElementException { } }

implementation:
Node setOrRemove = getFirstChild ( root , new String [ ] { "remove" , "set" } ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
ensureNotNull ( Policy . bind ( "ensure.missingRemoveOrSetElmt" ) , setOrRemove ) ; // $ NON - NLS - 1 $
Node property = null ; while ( setOrRemove != null && property == null ) { Node prop = getFirstChild ( ( Element ) setOrRemove , "prop" ) ; // $ NON - NLS - 1 $
ensureNotNull ( Policy . bind ( "ensure.missingPropElmt" ) , prop ) ; // $ NON - NLS - 1 $
property = getChildElement ( ( Element ) prop , true ) ; if ( property == null ) setOrRemove = getNextSibling ( ( Element ) setOrRemove , new String [ ] { "remove" , "set" } ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} final Node a = setOrRemove ; final Node c = property ; Enumeration e = new Enumeration ( ) { Node currentSetOrRemove = a ; Node currentProperty = c ; public boolean hasMoreElements ( ) { return currentProperty != null ; } public Object nextElement ( ) { if ( ! hasMoreElements ( ) ) throw new NoSuchElementException ( ) ; Directive result = null ; try { result = new Directive ( ( Element ) currentProperty ) ; } catch ( MalformedElementException ex ) { Assert . isTrue ( false , Policy . bind ( "assert.internalError" ) ) ; // $ NON - NLS - 1 $
} currentProperty = getNextSibling ( ( Element ) currentProperty ) ; while ( currentSetOrRemove != null && currentProperty == null ) { currentSetOrRemove = getNextSibling ( ( Element ) currentSetOrRemove , new String [ ] { "remove" , "set" } ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
if ( currentSetOrRemove != null ) { Node prop = getFirstChild ( ( Element ) currentSetOrRemove , "prop" ) ; // $ NON - NLS - 1 $
if ( prop != null ) currentProperty = getChildElement ( ( Element ) prop , true ) ; } } return result ; } } ; return e ;


signature:
public class AbstractKieRequestDialog { /** * / * ( non - Javadoc )
 * @ see org . eclipse . jface . dialogs . TitleAreaDialog # createContents ( org . eclipse . swt . widgets . Composite ) */
@ Override protected Control createContents ( Composite parent ) { } }

implementation: Control contents = super . createContents ( parent ) ; setTitle ( title ) ; validate ( ) ; return contents ;


signature:
public class AbstractKieRequestDialog { /** * / * ( non - Javadoc )
 * @ see org . eclipse . jface . dialogs . TitleAreaDialog # createDialogArea ( org . eclipse . swt . widgets . Composite ) */
@ Override protected Control createDialogArea ( Composite parent ) { } }

implementation: Composite parentComposite = ( Composite ) super . createDialogArea ( parent ) ; Composite composite = new Composite ( parentComposite , SWT . NONE ) ; composite . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; composite . setLayout ( new GridLayout ( 3 , false ) ) ; composite . setFont ( parent . getFont ( ) ) ; createFields ( composite ) ; return parentComposite ;


signature:
public class AbstractKieRequestDialog { /** * / * ( non - Javadoc )
 * @ see org . eclipse . jface . dialogs . TrayDialog # createHelpControl ( org . eclipse . swt . widgets . Composite ) */
@ Override protected Control createHelpControl ( Composite parent ) { } }

implementation: ( ( GridLayout ) parent . getLayout ( ) ) . numColumns ++ ; errorComposite = new Composite ( parent , SWT . NONE ) ; GridData gd = new GridData ( SWT . FILL , SWT . FILL , true , true ) ; errorComposite . setLayoutData ( gd ) ; errorComposite . setLayout ( new GridLayout ( 2 , false ) ) ; Label errorImage = new Label ( errorComposite , SWT . NONE ) ; errorImage . setLayoutData ( new GridData ( SWT . BEGINNING , SWT . CENTER , false , false ) ) ; errorImage . setImage ( JFaceResources . getImage ( DLG_IMG_TITLE_ERROR ) ) ; errorText = new Label ( errorComposite , SWT . NONE ) ; gd = new GridData ( SWT . FILL , SWT . CENTER , true , false ) ; errorText . setLayoutData ( gd ) ; errorText . setText ( "" ) ; return errorComposite ;


signature:
public class AbstractKieRequestDialog { /** * / * ( non - Javadoc )
 * @ see org . eclipse . jface . dialogs . TitleAreaDialog # setErrorMessage ( java . lang . String ) */
@ Override public void setErrorMessage ( String newErrorMessage ) { } }

implementation: if ( errorComposite != null && ! errorComposite . isDisposed ( ) ) { if ( newErrorMessage == null || newErrorMessage . isEmpty ( ) ) { errorComposite . setVisible ( false ) ; ( ( GridData ) errorComposite . getLayoutData ( ) ) . exclude = true ; errorText . setText ( "" ) ; } else { errorComposite . setVisible ( true ) ; ( ( GridData ) errorComposite . getLayoutData ( ) ) . exclude = false ; errorText . setText ( newErrorMessage ) ; } errorText . getParent ( ) . getParent ( ) . layout ( ) ; }


signature:
public class AbstractKieRequestDialog { /** * / * ( non - Javadoc )
 * @ see org . eclipse . jface . dialogs . Dialog # createButton ( org . eclipse . swt . widgets . Composite , int , java . lang . String , boolean ) */
@ Override protected Button createButton ( Composite parent , int id , String label , boolean defaultButton ) { } }

implementation: Button button = super . createButton ( parent , id , label , defaultButton ) ; if ( id == IDialogConstants . OK_ID ) okButton = button ; return button ;


signature:
public class WebDAVFactory { /** * Answer a new resource locator that identifies a particular
 * server resource by it ' s URL and label .
 * @ param resourceURL the URL of the resource .
 * @ param label the version label of the resource .
 * @ return the Locator to the resource . */
public ILocator newLocator ( String resourceURL , String label ) { } }

implementation: return locatorFactory . newLocator ( resourceURL , label ) ;


signature:
public class DRLSourceViewerConfig { /** * Define reconciler - this has to be done for each partition .
 * Currently there are 3 partitions , Inside rule , outside rule and inside comment . */
public IPresentationReconciler getPresentationReconciler ( ISourceViewer sourceViewer ) { } }

implementation:
PresentationReconciler reconciler = new PresentationReconciler ( ) ; // bucket partition . . . ( everything else outside a rule )
DefaultDamagerRepairer dr = new DefaultDamagerRepairer ( getScanner ( ) ) ; reconciler . setDamager ( dr , IDocument . DEFAULT_CONTENT_TYPE ) ; reconciler . setRepairer ( dr , IDocument . DEFAULT_CONTENT_TYPE ) ; // inside a rule partition
dr = new DefaultDamagerRepairer ( getScanner ( ) ) ; reconciler . setDamager ( dr , DRLPartionScanner . RULE_PART_CONTENT ) ; reconciler . setRepairer ( dr , DRLPartionScanner . RULE_PART_CONTENT ) ; // finally , inside a multi line comment .
dr = new DefaultDamagerRepairer ( new SingleTokenScanner ( new TextAttribute ( ColorManager . getInstance ( ) . getColor ( ColorManager . SINGLE_LINE_COMMENT ) ) ) ) ; reconciler . setDamager ( dr , DRLPartionScanner . RULE_COMMENT ) ; reconciler . setRepairer ( dr , DRLPartionScanner . RULE_COMMENT ) ; return reconciler ;


signature:
public class DRLSourceViewerConfig { /** * Get the appropriate content assistance , for each partition . */
public IContentAssistant getContentAssistant ( ISourceViewer sourceViewer ) { } }

implementation:
ContentAssistant assistant = new ContentAssistant ( ) ; // setup the content assistance , which is
// sensitive to the partition that it is in .
assistant . setContentAssistProcessor ( new DefaultCompletionProcessor ( editor ) , IDocument . DEFAULT_CONTENT_TYPE ) ; assistant . setContentAssistProcessor ( new RuleCompletionProcessor ( editor ) , DRLPartionScanner . RULE_PART_CONTENT ) ; assistant . setProposalPopupOrientation ( IContentAssistant . PROPOSAL_OVERLAY ) ; return assistant ;


signature:
public class Status { /** * Answers whether the receiver and the argument are considered
 * identical . To be identical , the receiver and the argument
 * must have the same status code , message , and extended status
 * information .
 * @ param obj other object with which to test .
 * @ return boolean indicating whether they are the same or not .
 * @ see Status # equals ( Object ) */
public boolean sameAs ( Object obj ) { } }

implementation: if ( obj == null || ! ( obj instanceof Status ) ) return false ; Status other = ( Status ) obj ; if ( other . code != code || ! other . message . equals ( message ) ) return false ; return other . extendedStatus . equals ( extendedStatus ) ;


signature:
public class Condition { /** * Does this Condition contain the given ConditionTerm ?
 * @ param term the term to check for
 * @ return true if the condition contains the given term , false otherwise */
public boolean contains ( ConditionTerm term ) { } }

implementation:
// iterate through the factors looking for a match
boolean match = false ; Enumeration terms = getConditionTerms ( ) ; while ( ! match && terms . hasMoreElements ( ) ) { ConditionTerm t = ( ConditionTerm ) terms . nextElement ( ) ; match = term . matches ( t ) ; } return match ;


signature:
public class Condition { /** * Create a Condition by parsing the given If header as defined by
 * section 9.4 in the WebDAV spec .
 * @ param tokenizer a StreamTokenizer on the contents of a WebDAV If header
 * @ return the parsed condition */
public static Condition create ( StreamTokenizer tokenizer ) throws WebDAVException { } }

implementation:
Condition condition = new Condition ( ) ; try { int token = tokenizer . ttype ; if ( token == '<' ) { token = tokenizer . nextToken ( ) ; if ( token == StreamTokenizer . TT_WORD ) { condition . setResourceURI ( tokenizer . sval ) ; } else { throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissingResource" ) ) ; // $ NON - NLS - 1 $
} token = tokenizer . nextToken ( ) ; if ( token == '>' ) { token = tokenizer . nextToken ( ) ; } else { throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissing" , String . valueOf ( token ) , ">" ) ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} } if ( token == '(' ) { while ( token == '(' ) { condition . addConditionTerm ( ConditionTerm . create ( tokenizer ) ) ; token = tokenizer . ttype ; } } else { throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissingStart" , String . valueOf ( token ) ) ) ; // $ NON - NLS - 1 $
} } catch ( IOException exc ) { // ignore or log ?
} return condition ;


signature:
public class Condition { /** * Create a Condition by parsing the given If header as defined by
 * section 9.4 in the WebDAV spec .
 * @ param ifHeader the contents of a WebDAV If header
 * @ return the parsed condition
 * @ exception WebDAVException thrown if there is a syntax error in the header */
public static Condition create ( String ifHeader ) throws WebDAVException { } }

implementation:
StreamTokenizer tokenizer = new StreamTokenizer ( new StringReader ( ifHeader ) ) ; // URI characters
tokenizer . wordChars ( '!' , '/' ) ; tokenizer . wordChars ( ':' , '@' ) ; tokenizer . ordinaryChar ( '(' ) ; tokenizer . ordinaryChar ( ')' ) ; tokenizer . ordinaryChar ( '<' ) ; tokenizer . ordinaryChar ( '>' ) ; tokenizer . ordinaryChar ( '[' ) ; tokenizer . ordinaryChar ( ']' ) ; tokenizer . quoteChar ( '"' ) ; Condition condition = null ; try { int token = tokenizer . nextToken ( ) ; condition = Condition . create ( tokenizer ) ; token = tokenizer . ttype ; if ( token != StreamTokenizer . TT_EOF ) { throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissing" , String . valueOf ( token ) , "EOF" ) ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} } catch ( IOException exc ) { // ignore or log ?
} return condition ;


signature:
public class Prop { /** * Creates a clone of the given element and adds it to this prop . The
 * element must not be < code > null < / code > .
 * @ param element any element
 * @ throws MalformedElementException if there is reason to
 * believe that the given element is not well formed */
public void addProperty ( Element element ) throws MalformedElementException { } }

implementation: Assert . isNotNull ( element ) ; extractNode ( root , element ) ;


signature:
public class Prop { /** * Creates a new element with the given name and adds it to this prop .
 * The name must not be < code > null < / code > and its qualifier and local
 * name must not be < code > null < / code > and must not be the empty string .
 * @ param name the < code > QualifiedName < / code > of the property to add */
public void addPropertyName ( QualifiedName name ) { } }

implementation:
Assert . isNotNull ( name ) ; String nsName = name . getQualifier ( ) ; Assert . isTrue ( ! "" . equals ( nsName ) ) ; // $ NON - NLS - 1 $
String localName = name . getLocalName ( ) ; Assert . isNotNull ( localName ) ; Assert . isTrue ( ! localName . equals ( "" ) ) ; // $ NON - NLS - 1 $
Document document = root . getOwnerDocument ( ) ; Element element = document . createElement ( localName ) ; declareNS ( element , null , nsName ) ; root . appendChild ( element ) ;


signature:
public class Prop { /** * Returns an < code > Enumeration < / code > over this prop ' s property
 * < code > Element < / code > s .
 * @ returns an < code > Enumeration < / code > of < / code > Element < / code > s
 * @ throws MalformedElementException if there is reason to believe that
 * this editor ' s underlying element is not well formed */
public Enumeration getProperties ( ) throws MalformedElementException { } }

implementation: Node firstChild = getChildElement ( root , true ) ; final Node firstElement = firstChild ; Enumeration e = new Enumeration ( ) { Node currentElement = firstElement ; public boolean hasMoreElements ( ) { return currentElement != null ; } public Object nextElement ( ) { if ( ! hasMoreElements ( ) ) throw new NoSuchElementException ( ) ; Node nextElement = currentElement ; currentElement = getNextSibling ( ( Element ) currentElement ) ; return nextElement ; } } ; return e ;


signature:
public class Prop { /** * Returns an < code > Enumeration < / code > over this prop ' s property
 * < code > QualifiedName < / code > s .
 * @ returns an < code > Enumeration < / code > of < / code > QualifiedName < / code > s
 * @ throws MalformedElementException if there is reason to believe that
 * this editor ' s underlying element is not well formed */
public Enumeration getPropertyNames ( ) throws MalformedElementException { } }

implementation:
Node firstChild = getChildElement ( root , true ) ; final Node firstElement = firstChild ; Enumeration e = new Enumeration ( ) { Node currentElement = firstElement ; public boolean hasMoreElements ( ) { return currentElement != null ; } public Object nextElement ( ) { if ( ! hasMoreElements ( ) ) throw new NoSuchElementException ( ) ; String nsName = null ; try { nsName = getNSName ( ( Element ) currentElement ) ; } catch ( MalformedElementException ex ) { Assert . isTrue ( false , Policy . bind ( "assert.internalError" ) ) ; // $ NON - NLS - 1 $
} String localName = getNSLocalName ( ( Element ) currentElement ) ; QualifiedNameImpl name = new QualifiedNameImpl ( nsName , localName ) ; currentElement = getNextSibling ( ( Element ) currentElement ) ; return name ; } } ; return e ;


signature:
public class StateToken { /** * Create a StateToken by parsing the given If header as defined by
 * section 9.4 in the WebDAV spec .
 * @ param tokenizer a StreamTokenizer on the contents of a WebDAV If header
 * @ return the parsed ConditionFactor ( StateToken ) */
public static ConditionFactor create ( StreamTokenizer tokenizer ) throws WebDAVException { } }

implementation:
StateToken stateToken = new StateToken ( ) ; try { int token = tokenizer . ttype ; if ( token == '<' ) token = tokenizer . nextToken ( ) ; else throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissing" , String . valueOf ( token ) , "<" ) ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
if ( token == StreamTokenizer . TT_WORD ) { stateToken . setURI ( tokenizer . sval ) ; token = tokenizer . nextToken ( ) ; } else throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissingURI" , String . valueOf ( token ) ) ) ; // $ NON - NLS - 1 $
if ( token == '>' ) token = tokenizer . nextToken ( ) ; else throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissing" , String . valueOf ( token ) , ">" ) ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} catch ( IOException exc ) { // ignore or log ?
} return stateToken ;


signature:
public class DRLRuleEditor2 { /** * Adds Text Editor for rules and Rete graph viewer
 * @ see org . eclipse . ui . forms . editor . FormEditor # addPages ( ) */
protected void addPages ( ) { } }

implementation: try { textEditor = new DRLRuleEditor ( ) { public void close ( boolean save ) { super . close ( save ) ; DRLRuleEditor2 . this . close ( save ) ; } protected void setPartName ( String partName ) { super . setPartName ( partName ) ; DRLRuleEditor2 . this . setPartName ( partName ) ; } } ; reteViewer = new ReteViewer ( textEditor ) ; int text = addPage ( textEditor , getEditorInput ( ) ) ; int rete = addPage ( reteViewer , getEditorInput ( ) ) ; setPageText ( text , "Text Editor" ) ; setPageText ( rete , "Rete Tree" ) ; textEditor . getDocumentProvider ( ) . getDocument ( getEditorInput ( ) ) . addDocumentListener ( new IDocumentListener ( ) { public void documentAboutToBeChanged ( DocumentEvent event ) { } public void documentChanged ( DocumentEvent event ) { reteViewer . fireDocumentChanged ( ) ; } } ) ; } catch ( PartInitException e ) { DroolsEclipsePlugin . log ( e ) ; }


signature:
public class DRLRuleEditor2 { /** * / * ( non - Javadoc )
 * @ see org . eclipse . ui . part . MultiPageEditorPart # getAdapter ( java . lang . Class ) */
public Object getAdapter ( @ SuppressWarnings ( "rawtypes" ) Class adapter ) { } }

implementation: if ( adapter == ZoomManager . class ) { if ( getActiveEditor ( ) instanceof ReteViewer ) { return reteViewer . getAdapter ( adapter ) ; } else if ( getActiveEditor ( ) instanceof DRLRuleEditor ) { return null ; } } else if ( adapter == ZoomInAction2 . class ) { return zoomIn ; } else if ( adapter == ZoomOutAction2 . class ) { return zoomOut ; } else if ( adapter == ZoomComboContributionItem . class ) { return zitem ; } return textEditor . getAdapter ( adapter ) ;


signature:
public class KieServiceDelegate { /** * Send an HTTP DELETE request to the KIE console .
 * @ param request - the request URL fragment ; see the Drools REST API
 * documentation for details
 * @ return the Job ID . This can be used in calls to getJobStatus ( ) to fetch
 * the completion status of the request .
 * @ throws IOException */
protected String httpDelete ( String request ) throws IOException { } }

implementation: String host = getKieRESTUrl ( ) ; URL url = new URL ( host + "/" + request ) ; Activator . println ( "[DELETE] " + url . toString ( ) ) ; HttpURLConnection conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setRequestMethod ( "DELETE" ) ; conn . setRequestProperty ( "Content" , "application/json" ) ; setHttpCredentials ( conn ) ; String response = new BufferedReader ( new InputStreamReader ( ( conn . getInputStream ( ) ) ) ) . readLine ( ) ; Activator . println ( "[DELETE] response: " + response ) ; if ( conn . getResponseCode ( ) != HttpURLConnection . HTTP_ACCEPTED ) { throw new IOException ( "HTTP DELETE failed : HTTP error code : " + conn . getResponseCode ( ) ) ; } JsonObject jo = JsonObject . readFrom ( response ) ; String status = jo . get ( "status" ) . asString ( ) ; if ( status != null && ! status . isEmpty ( ) ) { if ( ! "APPROVED" . equals ( status ) ) throw new IOException ( "HTTP DELETE failed : Request status code : " + status ) ; } String jobId = jo . get ( "jobId" ) . asString ( ) ; if ( jobId != null && ! jobId . isEmpty ( ) ) return jobId ; return response ;


signature:
public class KieServiceDelegate { /** * Send an HTTP POST request to the KIE console .
 * @ param request - the request URL fragment ; see the Drools REST API
 * documentation for details
 * @ param body - the JSON object required by the request
 * @ return the Job ID . This can be used in calls to getJobStatus ( ) to fetch
 * the completion status of the request .
 * @ throws IOException
 * @ throws RuntimeException */
protected String httpPost ( String request , JsonObject body ) throws IOException , RuntimeException { } }

implementation: String host = getKieRESTUrl ( ) ; URL url = new URL ( host + "/" + request ) ; Activator . println ( "[POST] " + url . toString ( ) + " body: " + body ) ; HttpURLConnection conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setDoOutput ( body != null ) ; conn . setRequestMethod ( "POST" ) ; conn . setRequestProperty ( "Content-Type" , "application/json" ) ; setHttpCredentials ( conn ) ; if ( body != null ) { java . io . OutputStream os = conn . getOutputStream ( ) ; Writer writer = new OutputStreamWriter ( os , "UTF-8" ) ; body . writeTo ( writer ) ; writer . close ( ) ; os . flush ( ) ; } String response = new BufferedReader ( new InputStreamReader ( ( conn . getInputStream ( ) ) ) ) . readLine ( ) ; Activator . println ( "[POST] response: " + response ) ; if ( conn . getResponseCode ( ) != HttpURLConnection . HTTP_ACCEPTED ) { throw new IOException ( "HTTP POST failed : HTTP error code : " + conn . getResponseCode ( ) ) ; } JsonObject jo = JsonObject . readFrom ( response ) ; String status = jo . get ( "status" ) . asString ( ) ; if ( status != null && ! status . isEmpty ( ) ) { if ( ! "APPROVED" . equals ( status ) ) throw new IOException ( "HTTP POST failed : Request status code : " + status ) ; } String jobId = jo . get ( "jobId" ) . asString ( ) ; if ( jobId != null && ! jobId . isEmpty ( ) ) return jobId ; return response ;


signature:
public class KieServiceDelegate { /** * Sends a job status request to the KIE Server .
 * @ param jobId - the job ID from a previous HTTP POST or DELETE request
 * @ return a string composed of a status word ( e . g . " SUCCESS " or
 * " BAD _ REQUEST " ) followed by a colon delimiter and a detailed
 * message .
 * @ throws IOException */
public String getJobStatus ( final String jobId , final String title ) throws IOException , InterruptedException { } }

implementation:
final AtomicReference < String > ar = new AtomicReference < String > ( ) ; IWorkbench wb = PlatformUI . getWorkbench ( ) ; IProgressService ps = wb . getProgressService ( ) ; try { ps . busyCursorWhile ( new IRunnableWithProgress ( ) { public void run ( IProgressMonitor pm ) throws InterruptedException { pm . beginTask ( "Waiting for Job " + jobId + ":\n\n" + title , STATUS_REQUEST_TIMEOUT ) ; pm . subTask ( title ) ; long startTime = System . currentTimeMillis ( ) ; long stopTime = startTime ; do { try { // send a Job Status request every STATUS _ REQUEST _ DELAY milliseconds
Thread . sleep ( STATUS_REQUEST_DELAY ) ; String response = httpGet ( "jobs/" + jobId ) ; JsonObject jo = JsonObject . readFrom ( response ) ; String status = jo . get ( "status" ) . asString ( ) ; String result = jo . get ( "result" ) . asString ( ) ; if ( "null" . equals ( result ) ) { if ( ! "SUCCESS" . equals ( status ) ) result = null ; } if ( status != null && result != null ) ar . set ( status + ":" + result ) ; stopTime = System . currentTimeMillis ( ) ; pm . worked ( STATUS_REQUEST_DELAY ) ; Activator . println ( "status=" + status ) ; Activator . println ( "result=" + result ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } if ( pm . isCanceled ( ) ) throw new InterruptedException ( "Operation canceled" ) ; } while ( ar . get ( ) == null && stopTime - startTime < STATUS_REQUEST_TIMEOUT ) ; pm . done ( ) ; Activator . println ( "\n----------------------------------\n" + "Job " + jobId + "\n" + title + "\ncompleted in " + ( stopTime - startTime ) / 1000.0 + " sec\n" + "Status: " + ar . get ( ) + "\n----------------------------------\n" ) ; } } ) ; } catch ( InvocationTargetException e ) { e . printStackTrace ( ) ; return null ; } return ar . get ( ) ;


signature: public class WorkItemEditPart { protected void doubleClicked ( ) { } }

implementation:
super . doubleClicked ( ) ; // open custom editor pane if one exists
WorkDefinition workDefinition = getWorkDefinition ( ) ; if ( workDefinition instanceof WorkDefinitionExtension ) { String editor = ( ( WorkDefinitionExtension ) workDefinition ) . getCustomEditor ( ) ; if ( editor != null ) { Work work = openEditor ( editor , workDefinition ) ; if ( work != null ) { SetWorkCommand setCommand = new SetWorkCommand ( ) ; setCommand . setPropertyValue ( work ) ; CommandStack stack = getViewer ( ) . getEditDomain ( ) . getCommandStack ( ) ; stack . execute ( setCommand ) ; } } }


signature:
public class EditConnectionAction { /** * ( non - Javadoc )
 * @ see org . eclipse . ui . IActionDelegate # run ( org . eclipse . jface . action . IAction ) */
public void run ( IAction action ) { } }

implementation: EditRepLocationWizard editWizard = new EditRepLocationWizard ( rep ) ; editWizard . init ( Activator . getDefault ( ) . getWorkbench ( ) , null ) ; WizardDialog dialog = new WizardDialog ( Display . getCurrent ( ) . getActiveShell ( ) , editWizard ) ; dialog . create ( ) ; dialog . open ( ) ;


signature:
public class ZoomOutAction2 { /** * Replaces existing zoomManager with the new one .
 * Implementation is null - safe .
 * @ param newManager new zoom manager */
public void setZoomManager ( ZoomManager manager ) { } }

implementation: if ( zoomManager != null ) { zoomManager . removeZoomListener ( this ) ; } zoomManager = manager ; if ( zoomManager != null ) { zoomManager . addZoomListener ( this ) ; }


signature:
public class Update { /** * Creates a new WebDAV update element and sets it as the root of
 * the given document . Returns an editor on the new element .
 * The document must not be < code > null < / code > , and must not already have
 * a root element . < / p >
 * @ param document the document that will become the root of a new
 * update element .
 * @ return an element editor on an update element . */
public static Update createLabel ( Document document , String label ) { } }

implementation:
Assert . isNotNull ( document ) ; Assert . isTrue ( document . getOwnerDocument ( ) == null ) ; Assert . isNotNull ( label ) ; Element element = create ( document , "update" ) ; // $ NON - NLS - 1 $
try { Update editor = new Update ( element ) ; editor . setLabelName ( label ) ; return editor ; } catch ( MalformedElementException e ) { Assert . isTrue ( false , Policy . bind ( "assert.internalError" ) ) ; // $ NON - NLS - 1 $
return null ; // Never reached .
}


signature:
public class Update { /** * Creates a new WebDAV update element and sets it as the root of
 * the given document . Returns an editor on the new element .
 * The document must not be < code > null < / code > , and must not already have
 * a root element . < / p >
 * @ param document the document that will become the root of a new
 * update element
 * @ return an element editor on a set - target element */
public static Update createVersion ( Document document , String href ) { } }

implementation:
Assert . isNotNull ( document ) ; Assert . isTrue ( document . getOwnerDocument ( ) == null ) ; Assert . isNotNull ( href ) ; Element element = create ( document , "update" ) ; // $ NON - NLS - 1 $
try { Update editor = new Update ( element ) ; editor . setVersion ( href ) ; return editor ; } catch ( MalformedElementException e ) { Assert . isTrue ( false , Policy . bind ( "assert.internalError" ) ) ; // $ NON - NLS - 1 $
return null ; // Never reached .
}


signature:
public class Update { /** * Returns this response ' s first DAV : version child element .
 * @ return this response ' s first version href .
 * @ throws MalformedElementException if there is reason to believe that
 * this editor ' s underlying element is not well formed */
public String getVersion ( ) throws MalformedElementException { } }

implementation:
Element version = getFirstChild ( root , "version" ) ; // $ NON - NLS - 1 $
ensureNotNull ( Policy . bind ( "ensure.missingVersionElmt" ) , version ) ; // $ NON - NLS - 1 $
String href = getChildText ( version , "href" , true ) ; // $ NON - NLS - 1 $
ensureNotNull ( Policy . bind ( "ensure.missingHrefElmt" ) , href ) ; // $ NON - NLS - 1 $
return decodeHref ( href ) ;


signature:
public class Update { /** * Sets the DAV : label child element .
 * @ param label the string label to the version .
 * @ throws MalformedElementException if there is reason to believe that
 * this editor ' s underlying element is not well formed */
public void setLabelName ( String label ) throws MalformedElementException { } }

implementation:
Element child = getFirstChild ( root , childNames ) ; // If there is a version child already there remove it .
if ( isDAVElement ( child , "version" ) ) // $ NON - NLS - 1 $
root . removeChild ( child ) ; // Add / update the label - name element .
setChild ( child , "label-name" , label , new String [ ] { "label-name" } , true ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $


signature:
public class Update { /** * Sets the DAV : version child element .
 * @ param href the string href to the version .
 * @ throws MalformedElementException if there is reason to believe that
 * this editor ' s underlying element is not well formed */
public void setVersion ( String href ) throws MalformedElementException { } }

implementation:
Element child = getFirstChild ( root , childNames ) ; // If there is a label - name child remove it .
if ( isDAVElement ( child , "label-name" ) ) // $ NON - NLS - 1 $
root . removeChild ( child ) ; // Add / update a version element with the href of the version target .
Element newChild = setChild ( root , "version" , new String [ ] { "version" } , true ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
setChild ( newChild , "href" , encodeHref ( href ) , new String [ ] { "href" } , true ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $


signature:
public class PullOperationUI { /** * Starts this operation synchronously .
 * @ param monitor */
@ SuppressWarnings ( "restriction" ) public void execute ( IProgressMonitor monitor ) { } }

implementation: try { pullOperation . execute ( monitor ) ; results . putAll ( pullOperation . getResults ( ) ) ; } catch ( CoreException e ) { if ( e . getStatus ( ) . getSeverity ( ) == IStatus . CANCEL ) results . putAll ( pullOperation . getResults ( ) ) ; else repoNode . handleException ( ( Throwable ) e ) ; }


signature:
public class PullOperationUI { /** * Post - process the pull results , allowing the user to deal with uncommitted
 * changes and re - pull if the initial pull failed because of these changes
 * @ param resultsMap a copy of the initial pull results
 * @ param shell */
private void handlePullResults ( final Map < Repository , Object > resultsMap ) { } }

implementation: if ( tasksToWaitFor . decrementAndGet ( ) == 0 && ! results . isEmpty ( ) ) showResults ( ) ;


signature:
public class JsonArray { /** * Replaces the element at the specified position in this array with the JSON representation of
 * the specified string .
 * @ param index
 * the index of the array element to replace
 * @ param value
 * the string to be stored at the specified array position
 * @ return the array itself , to enable method chaining
 * @ throws IndexOutOfBoundsException
 * if the index is out of range , i . e . < code > index & lt ; 0 < / code > or
 * < code > index & gt ; = size < / code > */
public JsonArray set ( int index , String value ) { } }

implementation: values . set ( index , valueOf ( value ) ) ; return this ;


signature:
public class LockDiscovery { /** * Creates and adds a new activelock on this lockdiscovery and returns
 * an editor on it .
 * @ return an editor on an activelock element */
public ActiveLock addActiveLock ( ) { } }

implementation:
Element activelock = addChild ( root , "activelock" , childNames , false ) ; // $ NON - NLS - 1 $
Element locktype = appendChild ( activelock , "locktype" ) ; // $ NON - NLS - 1 $
appendChild ( locktype , "write" ) ; // $ NON - NLS - 1 $
ActiveLock result = null ; try { result = new ActiveLock ( activelock ) ; } catch ( MalformedElementException e ) { Assert . isTrue ( false , Policy . bind ( "assert.internalError" ) ) ; // $ NON - NLS - 1 $
} return result ;


signature:
public class LockDiscovery { /** * Returns an < code > Enumeration < / code > over this lockdiscovery ' s
 * < code > ActiveLock < / code > s .
 * @ return an < code > Enumeration < / code > of < code > ActiveLock < / code > s
 * @ throws MalformedElementException if there is reason to believe that
 * this editor ' s underlying element is not well formed */
public Enumeration getActiveLocks ( ) throws MalformedElementException { } }

implementation:
final Node firstActiveLock = getFirstChild ( root , "activelock" ) ; // $ NON - NLS - 1 $
Enumeration e = new Enumeration ( ) { Node currentActiveLock = firstActiveLock ; public boolean hasMoreElements ( ) { return currentActiveLock != null ; } public Object nextElement ( ) { if ( ! hasMoreElements ( ) ) throw new NoSuchElementException ( ) ; ActiveLock result = null ; try { result = new ActiveLock ( ( Element ) currentActiveLock ) ; } catch ( MalformedElementException ex ) { Assert . isTrue ( false , Policy . bind ( "assert.internalError" ) ) ; // $ NON - NLS - 1 $
} currentActiveLock = getTwin ( ( Element ) currentActiveLock , true ) ; return result ; } } ; return e ;


signature:
public class AbstractCompletionProcessor { /** * Filter out the proposals whose content does not start with the given prefix . */
protected static void filterProposalsOnPrefix ( String prefix , List < ICompletionProposal > props ) { } }

implementation: if ( prefix != null && prefix . trim ( ) . length ( ) > 0 ) { Iterator < ICompletionProposal > iterator = props . iterator ( ) ; String prefixLc = prefix . toLowerCase ( ) ; while ( iterator . hasNext ( ) ) { ICompletionProposal item = iterator . next ( ) ; String content = item . getDisplayString ( ) . toLowerCase ( ) ; if ( ! content . toLowerCase ( ) . startsWith ( prefixLc ) ) { iterator . remove ( ) ; } } }


signature:
public class AbstractCompletionProcessor { /** * Read some text from behind the cursor position .
 * This provides context to both filter what is shown based
 * on what the user has typed in , and also to provide more information for the
 * list of suggestions based on context . */
protected String readBackwards ( int documentOffset , IDocument doc ) throws BadLocationException { } }

implementation: int startPart = doc . getPartition ( documentOffset ) . getOffset ( ) ; String prefix = doc . get ( startPart , documentOffset - startPart ) ; return prefix ;


signature:
public class ReteooLayoutFactory { /** * Calculates layouting for provided graph .
 * @ param root graph root vertex
 * @ return Optimally layouted rows from provided graph */
public static RowList calculateReteRows ( BaseVertex root ) { } }

implementation: RowList rowList = new RowList ( ) ; rowList . add ( 0 , root ) ; int curRow = 0 ; final Set < BaseVertex > seenVertices = new HashSet < BaseVertex > ( ) ; seenVertices . add ( root ) ; while ( curRow < rowList . getDepth ( ) ) { final List < BaseVertex > rowVertices = rowList . get ( curRow ) . getVertices ( ) ; for ( final Iterator < BaseVertex > rowNodeIter = rowVertices . iterator ( ) ; rowNodeIter . hasNext ( ) ; ) { final BaseVertex rowNode = rowNodeIter . next ( ) ; final List < Connection > edges = rowNode . getSourceConnections ( ) ; for ( final Iterator < Connection > edgeIter = edges . iterator ( ) ; edgeIter . hasNext ( ) ; ) { final Connection edge = edgeIter . next ( ) ; final BaseVertex destNode = edge . getOpposite ( rowNode ) ; if ( ! seenVertices . contains ( destNode ) ) { rowList . add ( curRow + 1 , destNode ) ; seenVertices . add ( destNode ) ; } } seenVertices . add ( rowNode ) ; } ++ curRow ; } rowList . optimize ( ) ; return rowList ;


signature:
public class VertexFigure { /** * Painting antialiased vertex */
public void paint ( Graphics g ) { } }

implementation: g . setAntialias ( SWT . ON ) ; Rectangle r = getBounds ( ) . getCopy ( ) ; g . translate ( r . getLocation ( ) ) ; g . setBackgroundColor ( backgroundColor ) ; g . setForegroundColor ( borderColor ) ; g . fillArc ( 0 , 0 , 15 , 15 , 0 , 360 ) ; g . drawArc ( 0 , 0 , 14 , 14 , 0 , 360 ) ; super . paint ( g ) ;


signature:
public class VertexEditPartFactory { /** * ( non - Javadoc )
 * @ see org . eclipse . gef . EditPartFactory # createEditPart ( org . eclipse . gef . EditPart , java . lang . Object ) */
public EditPart createEditPart ( EditPart context , Object modelElement ) { } }

implementation:
// get EditPart for model element
EditPart part = getPartForElement ( modelElement ) ; // store model element in EditPart
part . setModel ( modelElement ) ; return part ;


signature:
public class VertexEditPartFactory { /** * Maps object to EditPart .
 * @ throws RuntimeException if no match was found */
private EditPart getPartForElement ( Object modelElement ) { } }

implementation: if ( modelElement instanceof ReteGraph ) { return new DiagramEditPart ( ) ; } if ( modelElement instanceof BaseVertex ) { return new VertexEditPart ( ) ; } if ( modelElement instanceof Connection ) { return new ConnectionEditPart ( ) ; } DroolsEclipsePlugin . log ( new Exception ( "Can't create part for model element: " + ( ( modelElement != null ) ? modelElement . getClass ( ) . getName ( ) : "null" ) ) ) ; return null ;


signature:
public class JBPMEclipsePlugin { /** * Returns an image descriptor for the image file at the given
 * plug - in relative path .
 * Uses the plug ins image registry to " cache " it .
 * @ param path the path
 * @ return the image descriptor */
public static ImageDescriptor getImageDescriptor ( String path ) { } }

implementation: JBPMEclipsePlugin plugin = getDefault ( ) ; ImageRegistry reg = plugin . getImageRegistry ( ) ; ImageDescriptor des = reg . getDescriptor ( path ) ; if ( des == null ) { des = AbstractUIPlugin . imageDescriptorFromPlugin ( "org.jbpm.eclipse" , path ) ; reg . put ( path , des ) ; } return des ;


signature:
public class DroolsPluginImages { /** * Declare an Image in the registry table .
 * @ param key The key to use when registering the image
 * @ param path The path where the image can be found . This path is relative to where
 * this plugin class is found ( i . e . typically the packages directory ) */
public final static void declareRegistryImage ( String key , String path ) { } }

implementation: ImageDescriptor desc = ImageDescriptor . getMissingImageDescriptor ( ) ; try { desc = ImageDescriptor . createFromURL ( makeIconFileURL ( path ) ) ; } catch ( MalformedURLException e ) { DroolsEclipsePlugin . log ( e ) ; } imageRegistry . put ( key , desc ) ;


signature:
public class DigestAuthority { /** * Returns the Digest authorization credentials for the given directives .
 * The credentials have the following form :
 * < code >
 * credentials = " Digest " digest - response
 * digest - response = 1 # ( username | realm | nonce | digest - uri
 * | response | [ algorithm ] | [ cnonce ] |
 * [ opaque ] | [ message - qop ] |
 * [ nonce - count ] | [ auth - param ] )
 * username = " username " " = " username - value
 * username - value = quoted - string
 * realm = " realm " " = " realm - value
 * realm - value = quoted - string
 * nonce = " nonce " " = " nonce - value
 * nonce - value = quoted - string
 * digest - uri = " uri " " = " digest - uri - value
 * digest - uri - value = request - uri ; As specified by HTTP / 1.1
 * response = " response " " = " request - digest
 * request - digest = & lt ; " & gt ; 32LHEX & lt ; " & gt ;
 * LHEX = " 0 " | " 1 " | " 2 " | " 3 " |
 * " 4 " | " 5 " | " 6 " | " 7 " |
 * " 8 " | " 9 " | " a " | " b " |
 * " c " | " d " | " e " | " f "
 * algorithm = " algorithm " " = " ( " MD5 " | " MD5 - sess " | token )
 * cnonce = " cnonce " " = " cnonce - value
 * cnonce - value = nonce - value
 * opaque = " opaque " " = " quoted - string
 * message - qop = " qop " " = " qop - value
 * nonce - count = " nc " " = " nc - value
 * nc - value = 8LHEX
 * < / code >
 * < P > If the " qop " value is " auth " or " auth - int " :
 * < code >
 * request - digest = & lt ; " & gt ; & lt ; KD ( H ( A1 ) , unq ( nonce - value )
 * " : " nc - value
 * " : " unq ( cnonce - value )
 * " : " unq ( qop - value )
 * " : " H ( A2)
 * ) & lt ; " & gt ;
 * KD ( secret , data ) = H ( concat ( secret , " : " , data ) )
 * H ( data ) = MD5 ( data )
 * unq ( data ) = unqouted ( data )
 * < / code >
 * < P > If the " qop " directive is not present :
 * < code >
 * request - digest = & lt ; " & gt ; & lt ; KD ( H ( A1 ) ,
 * unq ( nonce - value )
 * " : " H ( A2)
 * ) & lt ; " & gt ;
 * < / code >
 * < P > If the " algorithm " directive ' s value is " MD5 " or is unspecified ,
 * then A1 is :
 * < code >
 * A1 = unq ( username - value ) " : " unq ( realm - value ) " : " passwd
 * passwd = & lt ; user ' s password & gt ;
 * < / code >
 * < P > If the " algorithm " directive ' s value is " MD5 - sess " , then A1 is :
 * < code >
 * A1 = H ( unq ( username - value ) " : " unq ( realm - value )
 * " : " passwd )
 * " : " unq ( nonce - value ) " : " unq ( cnonce - value )
 * < / code >
 * < P > If the " qop " directive ' s value is " auth " or is unspecified , then
 * A2 is :
 * < code >
 * A2 = Method " : " digest - uri - value
 * < / code >
 * < P > If the " qop " value is " auth - int " , then A2 is :
 * < code >
 * A2 = Method " : " digest - uri - value " : " H ( entity - body )
 * < / code >
 * @ param request
 * @ param realm
 * @ param username
 * @ param password
 * @ param algorithm
 * @ param messageQop
 * @ param nonce
 * @ param nonceCount
 * @ param opaque
 * @ param cnonce
 * @ param method
 * @ param digestUri
 * @ return the Digest authorization credentials for the given
 * directives */
private String credentials ( Request request , String realm , String username , String password , String algorithm , String messageQop , String nonce , String nonceCount , String opaque , String cnonce , String method , String digestUri ) throws Exception { } }

implementation:
Assert . isNotNull ( request ) ; Assert . isNotNull ( realm ) ; Assert . isNotNull ( username ) ; Assert . isNotNull ( password ) ; Assert . isNotNull ( nonce ) ; Assert . isNotNull ( method ) ; Assert . isNotNull ( digestUri ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "Digest username=\"" ) ; // $ NON - NLS - 1 $
buf . append ( username ) ; buf . append ( "\"" ) ; // $ NON - NLS - 1 $
buf . append ( ", realm=" ) ; // $ NON - NLS - 1 $
buf . append ( realm ) ; if ( messageQop != null ) { buf . append ( ", qop=\"" ) ; // $ NON - NLS - 1 $
buf . append ( messageQop ) ; buf . append ( "\"" ) ; // $ NON - NLS - 1 $
} if ( algorithm != null ) { buf . append ( ", algorithm=" ) ; // $ NON - NLS - 1 $
buf . append ( algorithm ) ; } buf . append ( ", uri=\"" ) ; // $ NON - NLS - 1 $
buf . append ( digestUri ) ; buf . append ( "\"" ) ; // $ NON - NLS - 1 $
buf . append ( ", nonce=" ) ; // $ NON - NLS - 1 $
buf . append ( nonce ) ; if ( nonceCount != null ) { buf . append ( ", nc=" ) ; // $ NON - NLS - 1 $
buf . append ( nonceCount ) ; } if ( cnonce != null ) { buf . append ( ", cnonce=\"" ) ; // $ NON - NLS - 1 $
buf . append ( cnonce ) ; buf . append ( "\"" ) ; // $ NON - NLS - 1 $
} if ( opaque != null ) { buf . append ( ", opaque=" ) ; // $ NON - NLS - 1 $
buf . append ( opaque ) ; } String response = response ( request , realm , username , password , algorithm , messageQop , nonce , nonceCount , cnonce , method , digestUri ) ; if ( response == null ) { return null ; } buf . append ( ", response=\"" ) ; // $ NON - NLS - 1 $
buf . append ( response ) ; buf . append ( "\"" ) ; // $ NON - NLS - 1 $
return buf . toString ( ) ;


signature:
public class RowList { /** * Adds new vertex to specified depth
 * @ param depth depth for vertex
 * @ param vertex vertex */
public void add ( final int depth , final BaseVertex vertex ) { } }

implementation: if ( this . rows . size ( ) < ( depth + 1 ) ) { final int addRows = depth - this . rows . size ( ) + 1 ; for ( int i = 0 ; i < addRows ; ++ i ) { this . rows . add ( new Row ( ( depth - addRows ) + i ) ) ; } } ( ( Row ) this . rows . get ( depth ) ) . add ( vertex ) ;


signature:
public class RowList { /** * Finds specified vertex from the rows .
 * @ param vertex vertex
 * @ return row number where vertex was found ( 0 . . n - 1 ) . < code > - 1 < / code > if not found . */
public int getRow ( final BaseVertex vertex ) { } }

implementation: final int numRows = this . rows . size ( ) ; for ( int i = 0 ; i < numRows ; ++ i ) { if ( ( ( Row ) this . rows . get ( i ) ) . contains ( vertex ) ) { return i ; } } return - 1 ;


signature:
public class RowList { /** * Finds the longest row width .
 * @ return width of the longest row */
public int getWidth ( ) { } }

implementation: int width = 0 ; for ( final Iterator < Row > rowIter = this . rows . iterator ( ) ; rowIter . hasNext ( ) ; ) { final Row row = rowIter . next ( ) ; final int rowWidth = row . getWidth ( ) ; if ( rowWidth > width ) { width = rowWidth ; } } return width ;


signature:
public class RowList { /** * Dumps all row vertices to System . err */
public void dump ( ) { } }

implementation: final int numRows = this . rows . size ( ) ; for ( int i = 0 ; i < numRows ; ++ i ) { System . err . println ( i + ": " + get ( i ) . getVertices ( ) ) ; }


signature:
public class RowList { /** * Optimizes all rows for optimal presentation */
public void optimize ( ) { } }

implementation: final int numRows = this . rows . size ( ) ; for ( int i = 0 ; i < numRows ; ++ i ) { get ( i ) . optimize ( ) ; }


signature:
public class RuleSourceFieldRenameParticipant { /** * TODO : Search the Native way to find the SourceField IFile */
private IFile getSourceFieldIFile ( ) { } }

implementation: Field fReferences ; try { fReferences = processor . getClass ( ) . getDeclaredField ( "fReferences" ) ; fReferences . setAccessible ( true ) ; SearchResultGroup object [ ] = ( SearchResultGroup [ ] ) fReferences . get ( processor ) ; for ( SearchResultGroup searchResultGroup : object ) { if ( searchResultGroup . getResource ( ) instanceof IFile ) return ( IFile ) searchResultGroup . getResource ( ) ; } } catch ( SecurityException e ) { return null ; } catch ( NoSuchFieldException e ) { return null ; } catch ( IllegalArgumentException e ) { return null ; } catch ( IllegalAccessException e ) { return null ; } return null ;


signature:
public class ReteViewer { /** * / * ( non - Javadoc )
 * @ see org . eclipse . gef . ui . parts . GraphicalEditor # configureGraphicalViewer ( ) */
protected void configureGraphicalViewer ( ) { } }

implementation: super . configureGraphicalViewer ( ) ; GraphicalViewer viewer = getGraphicalViewer ( ) ; viewer . getControl ( ) . setBackground ( ColorConstants . white ) ; viewer . setEditPartFactory ( new VertexEditPartFactory ( ) ) ; viewer . setRootEditPart ( rootEditPart ) ; viewer . setKeyHandler ( new GraphicalViewerKeyHandler ( viewer ) ) ;


signature:
public class ReteViewer { /** * / * ( non - Javadoc )
 * @ see org . eclipse . gef . ui . parts . GraphicalEditor # getAdapter ( java . lang . Class ) */
public Object getAdapter ( @ SuppressWarnings ( "rawtypes" ) Class type ) { } }

implementation: if ( type == ZoomManager . class ) return ( ( ScalableFreeformRootEditPart ) getGraphicalViewer ( ) . getRootEditPart ( ) ) . getZoomManager ( ) ; if ( type == GraphicalViewer . class ) return getGraphicalViewer ( ) ; if ( type == EditPart . class && getGraphicalViewer ( ) != null ) return getGraphicalViewer ( ) . getRootEditPart ( ) ; if ( type == IFigure . class && getGraphicalViewer ( ) != null ) return ( ( GraphicalEditPart ) getGraphicalViewer ( ) . getRootEditPart ( ) ) . getFigure ( ) ; return super . getAdapter ( type ) ;


signature:
public class ReteViewer { /** * Loads model from rule base ,
 * calculates rete view and initializes diagram model .
 * @ param monitor
 * @ param contents
 * @ return */
public ReteGraph loadReteModel ( IProgressMonitor monitor , String contents ) throws Throwable { } }

implementation: if ( relayoutRequired == false ) { return diagram ; } ReteGraph newDiagram = new ReteGraph ( ) ; try { monitor . beginTask ( "Loading RETE Tree" , 100 ) ; monitor . subTask ( "Loading Rule Base" ) ; InternalKnowledgeBase ruleBase = null ; try { IResource resource = drlEditor . getResource ( ) ; ClassLoader newLoader = DroolsBuilder . class . getClassLoader ( ) ; if ( resource . getProject ( ) . getNature ( "org.eclipse.jdt.core.javanature" ) != null ) { IJavaProject project = JavaCore . create ( resource . getProject ( ) ) ; newLoader = ProjectClassLoader . getProjectClassLoader ( project ) ; } DRLInfo drlInfo = DroolsEclipsePlugin . getDefault ( ) . parseResource ( drlEditor , true , true ) ; if ( drlInfo == null ) { throw new Exception ( "Could not find DRL info" ) ; } if ( drlInfo . getBuilderErrors ( ) . length > 0 ) { throw new Exception ( drlInfo . getBuilderErrors ( ) . length + " build errors" ) ; } if ( drlInfo . getParserErrors ( ) . size ( ) > 0 ) { throw new Exception ( drlInfo . getParserErrors ( ) . size ( ) + " parser errors" ) ; } InternalKnowledgePackage pkg = drlInfo . getPackage ( ) ; RuleBaseConfiguration config = new RuleBaseConfiguration ( ) ; config . setClassLoader ( newLoader ) ; ruleBase = KnowledgeBaseFactory . newKnowledgeBase ( config ) ; if ( pkg != null ) { ruleBase . addPackage ( pkg ) ; } } catch ( Throwable t ) { DroolsEclipsePlugin . log ( t ) ; throw new Exception ( MSG_PARSE_ERROR + " " + t . getMessage ( ) ) ; } monitor . worked ( 50 ) ; if ( monitor . isCanceled ( ) ) { throw new InterruptedException ( ) ; } monitor . subTask ( "Building RETE Tree" ) ; final ReteooVisitor visitor = new ReteooVisitor ( newDiagram ) ; visitor . visitInternalKnowledgeBase ( ruleBase ) ; monitor . worked ( 30 ) ; if ( monitor . isCanceled ( ) ) { throw new InterruptedException ( ) ; } monitor . subTask ( "Calculating RETE Tree Layout" ) ; BaseVertex rootVertex = visitor . getRootVertex ( ) ; RowList rowList = ReteooLayoutFactory . calculateReteRows ( rootVertex ) ; ReteooLayoutFactory . layoutRowList ( newDiagram , rowList ) ; zeroBaseDiagram ( newDiagram ) ; monitor . worked ( 20 ) ; if ( monitor . isCanceled ( ) ) { throw new InterruptedException ( ) ; } monitor . done ( ) ; } catch ( Throwable t ) { if ( ! ( t instanceof InterruptedException ) ) { DroolsEclipsePlugin . log ( t ) ; } throw t ; } relayoutRequired = false ; return newDiagram ;


signature:
public class ReteViewer { /** * Loads Rete model and initializes zoom manager . */
protected void initializeGraphicalViewer ( ) { } }

implementation:
ZoomManager zoomManager = rootEditPart . getZoomManager ( ) ; // List < String >
List < String > zoomLevels = new ArrayList < String > ( 3 ) ; zoomLevels . add ( ZoomManager . FIT_ALL ) ; zoomLevels . add ( ZoomManager . FIT_HEIGHT ) ; zoomLevels . add ( ZoomManager . FIT_WIDTH ) ; zoomManager . setZoomLevelContributions ( zoomLevels ) ; // Zoom mousewheel - Ctrl + Mousewheel for zoom in / out
getGraphicalViewer ( ) . setProperty ( MouseWheelHandler . KeyGenerator . getKey ( SWT . MOD1 ) , MouseWheelZoomHandler . SINGLETON ) ;


signature:
public class ReteViewer { /** * Moves all < code > diagram < / code > nodes to upper left corner
 * and shifting to right if neccessary to get rid of negative XY coordinates . */
private void zeroBaseDiagram ( ReteGraph graph ) { } }

implementation: Dimension dim = rootEditPart . getContentPane ( ) . getSize ( ) ; int minx = 0 , miny = 0 , maxx = 0 , x = dim . width ; final Iterator < BaseVertex > nodeIter = graph . getChildren ( ) . iterator ( ) ; while ( nodeIter . hasNext ( ) ) { Point loc = nodeIter . next ( ) . getLocation ( ) ; minx = Math . min ( loc . x , minx ) ; maxx = Math . max ( loc . x , maxx ) ; miny = Math . min ( loc . y , miny ) ; } int delta = ( x - ( maxx - minx + 20 ) ) / 2 ; minx = minx - ( delta ) ; final Iterator < BaseVertex > nodeIter2 = graph . getChildren ( ) . iterator ( ) ; while ( nodeIter2 . hasNext ( ) ) { final BaseVertex vertex = nodeIter2 . next ( ) ; Point loc = vertex . getLocation ( ) ; vertex . setLocation ( new Point ( loc . x - minx , loc . y - miny ) ) ; }


signature:
public class ReteViewer { /** * Draws graph .
 * @ param newGraph used to replace existing graph . if null then existing graph is simply redrawn . */
public void drawGraph ( ReteGraph newGraph ) { } }

implementation:
LayerManager manager = ( LayerManager ) getGraphicalViewer ( ) . getEditPartRegistry ( ) . get ( LayerManager . ID ) ; ConnectionLayer connLayer = ( ConnectionLayer ) manager . getLayer ( LayerConstants . CONNECTION_LAYER ) ; // Lazy - init model initialization
if ( getGraphicalViewer ( ) . getContents ( ) == null ) { getGraphicalViewer ( ) . setContents ( getModel ( ) ) ; } final boolean isNewDiagram = newGraph != null && newGraph != diagram ; if ( isNewDiagram ) { diagram . removeAll ( ) ; } // Update connection router according to new model size
ConnectionRouter router ; if ( ( isNewDiagram && newGraph . getChildren ( ) . size ( ) < SIMPLE_ROUTER_MIN_NODES ) || ( ! isNewDiagram && getModel ( ) . getChildren ( ) . size ( ) < SIMPLE_ROUTER_MIN_NODES ) ) { router = new ShortestPathConnectionRouter ( ( IFigure ) rootEditPart . getContentPane ( ) . getChildren ( ) . get ( 0 ) ) ; } else { router = ConnectionRouter . NULL ; } connLayer . setConnectionRouter ( router ) ; if ( newGraph != null && newGraph != diagram ) { diagram . addAll ( newGraph . getChildren ( ) ) ; }


signature:
public class DroolsDebugTarget { /** * Tries to find a match for the provided breakpoint information from the list of registered breakpoints .
 * For stepping and possibly other purposes it returns also a breakpoint for cases where exactly the same line was not found .
 * If breakpoint is not found for < code > line < / code > at < code > source < / code > then it takes the first line that is above the
 * specified line at the same file .
 * @ param source
 * @ param line
 * @ return */
public DroolsLineBreakpoint getDroolsBreakpoint ( String source ) { } }

implementation: if ( source == null ) { return null ; } Iterator < IBreakpoint > iterator = getBreakpoints ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { IJavaBreakpoint element = ( IJavaBreakpoint ) iterator . next ( ) ; if ( element instanceof DroolsLineBreakpoint && ( ( DroolsLineBreakpoint ) element ) . getDialectName ( ) . equals ( "mvel" ) ) { DroolsLineBreakpoint l = ( DroolsLineBreakpoint ) element ; try { int matchLine = l . getLineNumber ( ) ; String matchSource = l . getRuleName ( ) ; if ( source . equals ( matchSource ) || l . getFileRuleMappings ( ) . containsKey ( source ) ) { return l ; } } catch ( CoreException e ) { logError ( e ) ; } } } return null ;


signature:
public class OpenGuvnorWebConsoleAction { /** * ( non - Javadoc )
 * @ see org . eclipse . ui . IActionDelegate # run ( org . eclipse . jface . action . IAction ) */
public void run ( IAction action ) { } }

implementation: if ( selectedNode == null ) { return ; } IWorkbenchBrowserSupport browserSupport = Activator . getDefault ( ) . getWorkbench ( ) . getBrowserSupport ( ) ; try { URL consoleURL = new URL ( extractGuvnorConsoleUrl ( selectedNode . getGuvnorRepository ( ) . getLocation ( ) ) ) ; if ( browserSupport . isInternalWebBrowserAvailable ( ) ) { browserSupport . createBrowser ( null ) . openURL ( consoleURL ) ; } else { browserSupport . getExternalBrowser ( ) . openURL ( consoleURL ) ; } } catch ( Exception e ) { Activator . getDefault ( ) . displayError ( IStatus . ERROR , e . getMessage ( ) , e , true ) ; }


signature:
public class OpenGuvnorWebConsoleAction { /** * ( non - Javadoc )
 * @ see org . eclipse . ui . IActionDelegate # selectionChanged ( org . eclipse . jface . action . IAction , org . eclipse . jface . viewers . ISelection ) */
public void selectionChanged ( IAction action , ISelection selection ) { } }

implementation: action . setEnabled ( false ) ; if ( ! ( selection instanceof IStructuredSelection ) ) { return ; } IStructuredSelection sel = ( IStructuredSelection ) selection ; if ( sel . size ( ) != 1 ) { return ; } if ( sel . getFirstElement ( ) instanceof TreeObject ) { if ( ( ( TreeObject ) sel . getFirstElement ( ) ) . getNodeType ( ) == TreeObject . Type . REPOSITORY ) { selectedNode = ( TreeObject ) sel . getFirstElement ( ) ; action . setEnabled ( true ) ; } }


signature:
public class MappingEditor { /** * Pass in a NLMapping item for display / edits .
 * Changes will be applied to this object only if the user clicks OK . */
public void setNLMappingItem ( DSLMappingEntry item ) { } }

implementation: model = item ; setSection ( model . getSection ( ) ) ; exprText . setText ( model . getMappingKey ( ) == null ? "" : model . getMappingKey ( ) ) ; mappingText . setText ( model . getMappingValue ( ) == null ? "" : model . getMappingValue ( ) ) ; objText . setText ( model . getMetaData ( ) . getMetaData ( ) == null ? "" : model . getMetaData ( ) . getMetaData ( ) ) ;


signature:
public class BaselineControl { /** * Sets this baseline control elment description to the given href .
 * @ param href the href of the baseline . */
public void setHref ( String href ) { } }

implementation: Assert . isNotNull ( href ) ; setChild ( root , "href" , encodeHref ( href ) , childNames , true ) ; // $ NON - NLS - 1 $


signature:
public class AbstractResourceHandle { /** * Return a boolean value indicating whether or not the server for this resource
 * is DAV compliant .
 * @ return boolean < code > true < / code > if the server can respond to DAV
 * requests , or < code > false < / code > otherwise .
 * @ exception DAVException if there was a problem checking for DAV compliance */
public boolean canTalkDAV ( ) throws DAVException { } }

implementation:
IResponse response = null ; try { // Send an options request .
response = davClient . options ( locator , newContext ( ) ) ; examineResponse ( response ) ; // Check for at least DAV level 1.
String davHeader = response . getContext ( ) . getDAV ( ) ; return ! ( ( davHeader == null ) || ( davHeader . indexOf ( "1" ) == - 1 ) ) ; // $ NON - NLS - 1 $
} catch ( IOException exception ) { throw new SystemException ( exception ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Helper method to close a response from the server .
 * Note that the argument MAY be < code > null < / code > in which case
 * the call has no effect . < / p >
 * @ param response the response from the server , or < cod > null < / code >
 * denoting a no - op .
 * @ throws SystemException if a problem occurred closing the response . */
protected void closeResponse ( IResponse response ) throws SystemException { } }

implementation: if ( response == null ) return ; try { response . close ( ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; }


signature:
public class AbstractResourceHandle { /** * Make a copy of this resource and place it at the location defined
 * by the given locator .
 * Uses default values of depth : infinity and overwrite : false for
 * the copy . < / p >
 * @ param destination the < code > Locator < / code > to the destination of the copy .
 * @ exception DAVException if there was a problem copying this resource .
 * @ see IServer # copy ( ILocator , ILocator , IContext , Document ) */
public void copy ( ILocator destination ) throws DAVException { } }

implementation: copy ( destination , IContext . DEPTH_INFINITY , false , null ) ;


signature:
public class AbstractResourceHandle { /** * Make a copy of this resource and place it at the location specified
 * by the given destination locator .
 * @ param destination the location to put the copy .
 * @ param depth how deep to make the copy .
 * @ param overwrite how to react if a resource already exists at the destination .
 * @ param propertyNames < code > Collection < / code > of < code > QualifiedName < / code > s
 * of properties that MUST be copied as live properties . Specifying < code > null < / code >
 * mean that < i > all < / i > properties must be kept alive ; specifying an empty collection allows for
 * no properties to be kept live . ( ref http : / / andrew2 . andrew . cmu . edu / rfc / rfc2518 . html # sec - 12.12.1)
 * @ exception DAVException if there was a problem copying this resource .
 * @ see IServer # copy ( ILocator , ILocator , IContext , Document ) */
public void copy ( ILocator destination , String depth , boolean overwrite , Collection propertyNames ) throws DAVException { } }

implementation:
// Define the request context .
IContext context = newContext ( ) ; context . setDepth ( depth ) ; context . setOverwrite ( overwrite ) ; // Set up the request body to specify which properties should be kept alive .
Document document = newDocument ( ) ; PropertyBehavior propertyBehavior = PropertyBehavior . create ( document ) ; if ( propertyNames == null ) propertyBehavior . setIsKeepAllAlive ( true ) ; else { Iterator namesItr = propertyNames . iterator ( ) ; while ( namesItr . hasNext ( ) ) { QualifiedName name = ( QualifiedName ) namesItr . next ( ) ; String nameURI = name . getQualifier ( ) + "/" + name . getLocalName ( ) ; // $ NON - NLS - 1 $
propertyBehavior . addProperty ( nameURI ) ; } // end - while
} // end - if
// Call the server to perform the copy .
IResponse response = null ; try { response = davClient . copy ( locator , destination , context , document ) ; examineResponse ( response ) ; examineMultiStatusResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * If the given response contains a multistatus body , the bodies status '
 * are checked for errors . If an error is found , an exception is thrown .
 * @ param response the response from the server to examine .
 * @ throws DAVException if the given response contains a multistatus
 * body that contains a status code signalling an error . */
protected void examineMultiStatusResponse ( IResponse response ) throws DAVException { } }

implementation:
// If it is not a multistatus we don ' t look at it .
if ( response . getStatusCode ( ) != IResponse . SC_MULTI_STATUS ) return ; // It is declared a multistatus , so if there is no response body
// then that is a problem .
if ( ! response . hasDocumentBody ( ) ) throw new DAVException ( Policy . bind ( "exception.responseMustHaveDocBody" ) ) ; // $ NON - NLS - 1 $
// Extract the XML document from the response .
Element documentElement ; try { documentElement = response . getDocumentBody ( ) . getDocumentElement ( ) ; if ( documentElement == null ) throw new DAVException ( Policy . bind ( "exception.invalidDoc" ) ) ; // $ NON - NLS - 1 $
} catch ( IOException exception ) { throw new SystemException ( exception ) ; } // Enumerate all the responses in the multistat and check that
// they are indicating success ( i . e . are 200 - series response codes ) .
try { MultiStatus multistatus = new MultiStatus ( documentElement ) ; Enumeration responseEnum = multistatus . getResponses ( ) ; while ( responseEnum . hasMoreElements ( ) ) { ResponseBody responseBody = ( ResponseBody ) responseEnum . nextElement ( ) ; Enumeration propstatEnum = responseBody . getPropStats ( ) ; while ( propstatEnum . hasMoreElements ( ) ) { PropStat propstat = ( PropStat ) propstatEnum . nextElement ( ) ; examineStatusCode ( propstat . getStatusCode ( ) , propstat . getResponseDescription ( ) ) ; } // end - while
} // end - while
} catch ( MalformedElementException e ) { throw new SystemException ( e ) ; }


signature:
public class AbstractResourceHandle { /** * Helper method to extract the property status response from
 * a multi status reponse , and populate a URLTable with the
 * results .
 * @ param multiStatus an editor on the response from the server .
 * @ return all the property status in a < code > URLTable < / code > .
 * @ throws IOException if there is a problem parsing the resource URLs .
 * @ throws MalformedElementException if the XML is badly formed . */
protected URLTable extractPropStats ( MultiStatus multiStatus ) throws IOException , MalformedElementException { } }

implementation:
// Construct a URLTable to return to the user .
URLTable reply = new URLTable ( ) ; // For each response ( resource ) .
Enumeration responses = multiStatus . getResponses ( ) ; while ( responses . hasMoreElements ( ) ) { ResponseBody responseBody = ( ResponseBody ) responses . nextElement ( ) ; String href = responseBody . getHref ( ) ; // The href may be relative to the request URL .
URL resourceURL = new URL ( new URL ( locator . getResourceURL ( ) ) , href ) ; Hashtable properties = new Hashtable ( ) ; reply . put ( resourceURL , properties ) ; // For each property status grouping .
Enumeration propstats = responseBody . getPropStats ( ) ; while ( propstats . hasMoreElements ( ) ) { PropStat propstat = ( PropStat ) propstats . nextElement ( ) ; org . eclipse . webdav . dom . Status status = new org . eclipse . webdav . dom . Status ( propstat . getStatus ( ) ) ; // For each property with this status .
Enumeration elements = propstat . getProp ( ) . getProperties ( ) ; while ( elements . hasMoreElements ( ) ) { Element element = ( Element ) elements . nextElement ( ) ; QualifiedName name = ElementEditor . getQualifiedName ( element ) ; // Add a property status object to the result set .
PropertyStatus propertyStatus = new PropertyStatus ( element , status . getStatusCode ( ) , status . getStatusMessage ( ) ) ; properties . put ( name , propertyStatus ) ; } // end - while
} // end - while
} // end - while
return reply ;


signature:
public class AbstractResourceHandle { /** * Return the content of this resource as an input stream . The input
 * stream should be closed by the user .
 * @ return the input stream
 * @ exception DAVException if there was a problem getting the contents
 * @ see IServer # get ( Locator , Context ) */
public ResponseInputStream getContent ( ) throws DAVException { } }

implementation: IResponse response = null ; try { response = davClient . get ( locator , newContext ( ) ) ; examineResponse ( response ) ; } catch ( IOException e ) { closeResponse ( response ) ; throw new SystemException ( e ) ; } return new ResponseInputStream ( response ) ;


signature:
public class AbstractResourceHandle { /** * Return an Enumeration over ActiveLocks which lists the locks currently
 * held on this resource . Return an empty enumeration if the lock discovery
 * property is not found on the resource .
 * @ return the enumeration of active locks
 * @ exception DAVException if there was a problem getting the locks
 * @ see # getProperty ( QualifiedName ) */
public Enumeration getLocks ( ) throws DAVException { } }

implementation: LockDiscovery lockdiscovery = null ; try { Element element = getProperty ( DAV_LOCK_DISCOVERY ) . getProperty ( ) ; lockdiscovery = new LockDiscovery ( element ) ; return lockdiscovery . getActiveLocks ( ) ; } catch ( WebDAVException exception ) { if ( exception . getStatusCode ( ) == IResponse . SC_NOT_FOUND ) return new EmptyEnumeration ( ) ; throw exception ; } catch ( MalformedElementException elemException ) { throw new SystemException ( elemException ) ; }


signature:
public class AbstractResourceHandle { /** * Returns a collection handle for the parent of this resource .
 * Note that this method does NOT perform a method call to the
 * server to ensure that the collection exists . < / p >
 * Returns < code > null < / code > if this resource is the root .
 * < em > NOTE < / em >
 * The parent of a resource is , in general , ambiguous and may not
 * be immediately discernable from a resource locator . For example ,
 * a locator with a ' label ' qualifier will identify a version of a version -
 * controlled resource , and the parent will not be found by a simple URL
 * operation . Where a handle is created on a stable URL ( i . e . a version URL )
 * there is no concept of a ' parent ' resource .
 * Clients require further contextual information to determine
 * the ' parent ' of a resource in these cases .
 * @ return the handle for the parent of this resource , or
 * < code > null < / code > . */
public CollectionHandle getParent ( ) throws DAVException { } }

implementation: Assert . isTrue ( locator . getLabel ( ) == null ) ; Assert . isTrue ( ! locator . isStable ( ) ) ; try { URL url = URLTool . getParent ( locator . getResourceURL ( ) ) ; if ( url == null ) return null ; String parentName = url . toString ( ) ; ILocator parentLocator = davClient . getDAVFactory ( ) . newLocator ( parentName ) ; return new CollectionHandle ( davClient , parentLocator ) ; } catch ( MalformedURLException e ) { throw new SystemException ( e ) ; }


signature:
public class AbstractResourceHandle { /** * Fetches and returns the specified properties for this resource and its
 * children to the given depth . The returned table is a URLTable of
 * hashtables . The keys in the first table are the < code > URL < / code > s of
 * the resources . The nested table is a table where the keys are the names
 * ( < code > QualifiedName < / code > ) of the properties and the values are the
 * properties ' values ( < code > PropertyStatus < / code > ) .
 * @ param propertyNames collection of property names to search for
 * ( < code > QualifiedName < / code > ) , or < code > null < / code > to retrieve
 * all properties .
 * @ param depth the depth of the search ( eg . < code > Context . DEPTH _ INFINITY < / code > )
 * @ return URLTable of hashtables keyed by resource < code > URLKey < / code >
 * then by property name .
 * @ exception DAVException if there was a problem fetching the properties .
 * @ see IServer # propfind ( Locator , Context , Document ) */
public URLTable getProperties ( Collection propertyNames , String depth ) throws DAVException { } }

implementation:
// Set up the request context .
IContext context = newContext ( ) ; context . setDepth ( depth ) ; // Set up the request body .
Document document = newDocument ( ) ; PropFind propfind = PropFind . create ( document ) ; // null is a special value meaning ' all properties ' .
if ( propertyNames == null ) propfind . setIsAllProp ( true ) ; else { // Add all the property names to the request body .
Prop prop = propfind . setProp ( ) ; Iterator namesItr = propertyNames . iterator ( ) ; while ( namesItr . hasNext ( ) ) prop . addPropertyName ( ( QualifiedName ) namesItr . next ( ) ) ; } // Were ready to make the server call .
IResponse response = null ; try { // This contacts the server .
response = davClient . propfind ( locator , context , document ) ; examineResponse ( response ) ; // Create a multi - status element editor on the response .
if ( ! response . hasDocumentBody ( ) ) throw new DAVException ( Policy . bind ( "exception.respMustShareXMLDoc" ) ) ; // $ NON - NLS - 1 $
Element documentElement = response . getDocumentBody ( ) . getDocumentElement ( ) ; if ( documentElement == null ) throw new DAVException ( Policy . bind ( "exception.respHasInvalidDoc" ) ) ; // $ NON - NLS - 1 $
MultiStatus multiStatus = new MultiStatus ( documentElement ) ; // Construct a URLTable of results to return to the user .
return extractPropStats ( multiStatus ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } catch ( MalformedElementException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Return the property status for the property with the given name .
 * @ param propertyName the name of the property
 * @ return the property status
 * @ exception DAVException if there was a problem getting the property
 * @ see # getProperties ( Collection , String ) */
public PropertyStatus getProperty ( QualifiedName propertyName ) throws DAVException { } }

implementation:
Collection names = new HashSet ( ) ; names . add ( propertyName ) ; URLTable result = getProperties ( names , IContext . DEPTH_ZERO ) ; URL url = null ; try { url = new URL ( locator . getResourceURL ( ) ) ; } catch ( MalformedURLException e ) { throw new SystemException ( e ) ; } Hashtable propTable = ( Hashtable ) result . get ( url ) ; if ( propTable == null ) throw new DAVException ( Policy . bind ( "exception.lookup" , url . toExternalForm ( ) ) ) ; // $ NON - NLS - 1 $
return ( PropertyStatus ) propTable . get ( propertyName ) ;


signature:
public class AbstractResourceHandle { /** * Fetch and return the property names for the resource , and the children
 * resources to the specified depth . Returns < code > URLTable < / code >
 * mapping resource URLs to enumerations over the property names for that
 * resource .
 * @ param depth eg . < code > Context . DEPTH _ ZERO < / code >
 * @ return a < code > URLTable < / code > of < code > Enumerations < / code > over
 * < code > QualfiedNames < / code >
 * @ throws DAVException if there was a problem getting the property names
 * @ see IServer # propfind ( Locator , Context , Document ) */
public URLTable getPropertyNames ( String depth ) throws DAVException { } }

implementation:
// create and send the request
IContext context = newContext ( ) ; context . setDepth ( depth ) ; IResponse response = null ; try { Document document = newDocument ( ) ; PropFind propfind = PropFind . create ( document ) ; propfind . setIsPropName ( true ) ; response = davClient . propfind ( locator , context , document ) ; examineResponse ( response ) ; if ( ! response . hasDocumentBody ( ) ) { throw new DAVException ( Policy . bind ( "exception.respMustHaveElmtBody" ) ) ; // $ NON - NLS - 1 $
} Element documentElement = response . getDocumentBody ( ) . getDocumentElement ( ) ; if ( documentElement == null ) { throw new DAVException ( Policy . bind ( "exception.bodyMustHaveElmt" ) ) ; // $ NON - NLS - 1 $
} MultiStatus multistatus = new MultiStatus ( documentElement ) ; // construct the URLTable to return to the user
URLTable reply = new URLTable ( 10 ) ; Enumeration responses = multistatus . getResponses ( ) ; while ( responses . hasMoreElements ( ) ) { ResponseBody responseBody = ( ResponseBody ) responses . nextElement ( ) ; String href = responseBody . getHref ( ) ; URL resourceUrl = new URL ( new URL ( locator . getResourceURL ( ) ) , href ) ; Enumeration propstats = responseBody . getPropStats ( ) ; Vector vector = new Vector ( ) ; while ( propstats . hasMoreElements ( ) ) { PropStat propstat = ( PropStat ) propstats . nextElement ( ) ; Prop prop = propstat . getProp ( ) ; Enumeration names = prop . getPropertyNames ( ) ; while ( names . hasMoreElements ( ) ) { QualifiedName dname = ( QualifiedName ) names . nextElement ( ) ; vector . addElement ( dname ) ; } } reply . put ( resourceUrl , vector . elements ( ) ) ; } return reply ; } catch ( IOException e ) { throw new SystemException ( e ) ; } catch ( MalformedElementException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Retrieve the version tree infomration for the receiver , assuming
 * that the receiver is a version or a version - controlled resource .
 * The version tree info comprises a < code > URLTable < / code > whose keys
 * are the < code > URL < / code > s of each version in the version history ,
 * and whose values are < code > Vector < / code > s of the resource ' s immediate
 * predecessor < code > URL < / code > s . Note that the root version is
 * ( uniquely ) identified by an empty set of predecessors . < / p >
 * @ return the map from resource URL to predecessor set . */
public URLTable getVersionTree ( ) throws DAVException { } }

implementation:
// Issue a version tree report against the receiver to retrieve
// the successor set of all the versions .
Document document = newDocument ( ) ; Element root = ElementEditor . create ( document , "version-tree" ) ; // $ NON - NLS - 1 $
Element propElement = ElementEditor . appendChild ( root , "prop" ) ; // $ NON - NLS - 1 $
ElementEditor . appendChild ( propElement , "predecessor-set" ) ; // $ NON - NLS - 1 $
IResponse response = null ; try { // Run the REPORT and check for errors .
response = davClient . report ( locator , newContext ( ) , document ) ; examineResponse ( response ) ; if ( ! response . hasDocumentBody ( ) ) throw new DAVException ( Policy . bind ( "exception.respMustHaveElmtBody" ) ) ; // $ NON - NLS - 1 $
// Get the body as a MultiStatus .
Element documentElement = response . getDocumentBody ( ) . getDocumentElement ( ) ; if ( documentElement == null ) throw new DAVException ( Policy . bind ( "exception.bodyMustHaveElmt" ) ) ; // $ NON - NLS - 1 $
MultiStatus multistatus = new MultiStatus ( documentElement ) ; // Construct the predecessor table .
// This will contain the result .
URLTable predecessorTable = new URLTable ( ) ; // For each response .
Enumeration responses = multistatus . getResponses ( ) ; while ( responses . hasMoreElements ( ) ) { ResponseBody responseBody = ( ResponseBody ) responses . nextElement ( ) ; // Get the absolute URL of the resource .
String href = responseBody . getHref ( ) ; URL resourceURL = new URL ( new URL ( locator . getResourceURL ( ) ) , href ) ; // Add an entry to the predecessor table .
Vector predecessors = new Vector ( ) ; predecessorTable . put ( resourceURL , predecessors ) ; // For each propstat .
Enumeration propstats = responseBody . getPropStats ( ) ; while ( propstats . hasMoreElements ( ) ) { PropStat propstat = ( PropStat ) propstats . nextElement ( ) ; // We are going to assume that the status is OK , or error out .
if ( propstat . getStatusCode ( ) != IResponse . SC_OK ) throw new DAVException ( Policy . bind ( "exception.errorRetrievingProp" ) ) ; // $ NON - NLS - 1 $
// For each property in the prop ( there should only be one ) .
Prop prop = propstat . getProp ( ) ; Enumeration elements = prop . getProperties ( ) ; while ( elements . hasMoreElements ( ) ) { Element element = ( Element ) elements . nextElement ( ) ; // Look explicitly for the DAV : predecessor - set
QualifiedName name = ElementEditor . getQualifiedName ( element ) ; if ( name . equals ( DAV_PREDECESSOR_SET ) ) { Enumeration e = new HrefSet ( element , DAV_PREDECESSOR_SET ) . getHrefs ( ) ; while ( e . hasMoreElements ( ) ) { URL predURL = new URL ( ( String ) e . nextElement ( ) ) ; predecessors . add ( predURL ) ; } // end - while
} // end - if
} // end - while
} // end - while
} // end - while
// Phew , were done .
return predecessorTable ; } catch ( IOException e ) { throw new SystemException ( e ) ; } catch ( MalformedElementException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Return the header from a message send to the server .
 * @ return a context with the message header contents
 * @ exception DAVException if there was a problem sending the message
 * @ see IServer # head ( Locator , Context ) */
public IContext head ( ) throws DAVException { } }

implementation: IResponse response = null ; try { response = davClient . head ( locator , newContext ( ) ) ; examineResponse ( response ) ; return response . getContext ( ) ; } catch ( IOException exception ) { throw new SystemException ( exception ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Lock this resource using the specified parameters .
 * @ param isShared true if the lock is shared , false if the lock is exclusive
 * @ param depth eg . < code > Context . DEPTH _ ZERO < / code >
 * @ param timeout the timeout value for the lock
 * @ param owner the owner of the lock
 * @ return the lock token
 * @ exception DAVException if there was a problem locking this resource
 * @ see IServer # lock ( Locator , Context , Document ) */
public LockToken lock ( boolean isShared , String depth , int timeout , String owner ) throws DAVException { } }

implementation:
// Define the request context .
IContext context = newContext ( ) ; context . setDepth ( depth ) ; context . setTimeout ( timeout ) ; // Create the request body .
Document document = newDocument ( ) ; LockInfo lockinfo = LockInfo . create ( document ) ; lockinfo . setIsShared ( isShared ) ; // Add the owner if it is given .
if ( owner != null ) { Owner ownerEditor = lockinfo . setOwner ( ) ; ownerEditor . getElement ( ) . appendChild ( document . createTextNode ( owner ) ) ; } // Send the lock request .
IResponse response = null ; try { response = davClient . lock ( locator , context , document ) ; examineResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; } // Extract the token from the resulting context .
LockToken token = new LockToken ( response . getContext ( ) . getLockToken ( ) ) ; // fServerManager . addLock ( newURL ( fLocator . getResourceURL ( ) ) , token , depth ) ;
return token ;


signature:
public class AbstractResourceHandle { /** * Move this resource to the location specified by the given locator .
 * If a resource already exists at the destination and the overwrite
 * boolean is true , then write over top of the existing resource . Otherwise
 * do not . The enumeration is over qualified names which are the names of
 * the properties to move .
 * @ param destination the location to move to
 * @ param overwrite how to react if a resource already exists at the
 * destination
 * @ param names < code > Enumeration < / code > over < code > QualifiedNames < / code >
 * @ exception DAVException if there was a problem moving this resource
 * @ see IServer # move ( Locator , Locator , Context , Document ) */
public void move ( ILocator destination , boolean overwrite , Enumeration names ) throws DAVException { } }

implementation:
IContext context = newContext ( ) ; context . setOverwrite ( overwrite ) ; Document document = newDocument ( ) ; PropertyBehavior propertyBehavior = PropertyBehavior . create ( document ) ; if ( names == null ) { propertyBehavior . setIsKeepAllAlive ( true ) ; } else { while ( names . hasMoreElements ( ) ) { Object obj = names . nextElement ( ) ; Assert . isTrue ( obj instanceof QualifiedName , Policy . bind ( "assert.propNameMustBeEnumOverQual" ) ) ; // $ NON - NLS - 1 $
// fix this . . . can we really add property names to href elements ?
propertyBehavior . addProperty ( ( ( QualifiedName ) obj ) . getLocalName ( ) ) ; } } IResponse response = null ; try { response = davClient . move ( locator , destination , context , document ) ; examineResponse ( response ) ; examineMultiStatusResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Check in the receiver and answer a new Locator on the
 * resulting version resource .
 * @ return the < code > Locator < / code > to the receiver ' s version .
 * @ throws DAVException if a problem occurs with the check in request . */
protected ILocator protectedCheckIn ( ) throws DAVException { } }

implementation: IResponse response = null ; try { response = davClient . checkin ( locator , newContext ( ) , null ) ; examineResponse ( response ) ; String versionUrl = response . getContext ( ) . getLocation ( ) ; return davClient . getDAVFactory ( ) . newStableLocator ( versionUrl ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Check out the receiver and answer a new Locator on the
 * resulting checked out resource . The result MAY be the same
 * as the receiver ' s Locator if the server did not create
 * a new resource as a consequence of the check out ( i . e .
 * if it was checking out a vesion - controlled resource rather
 * than a version ) .
 * @ return the < code > Locator < / code > to the receiver ' s version .
 * @ throws DAVException if a problem occurs with the check in request . */
protected ILocator protectedCheckOut ( ) throws DAVException { } }

implementation: IResponse response = null ; try { response = davClient . checkout ( locator , newContext ( ) , null ) ; examineResponse ( response ) ; String resourceUrl = response . getContext ( ) . getLocation ( ) ; return davClient . getDAVFactory ( ) . newStableLocator ( resourceUrl ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Refresh the lock on this resource with the given lock token . Use
 * the specified timeout value .
 * @ param lockToken the lock token to refresh
 * @ param timeout the new timeout value to use
 * @ exception DAVException if there was a problem refreshing the lock */
public void refreshLock ( LockToken lockToken , int timeout ) throws DAVException { } }

implementation:
// Set up the request in the context .
IContext context = newContext ( ) ; context . setTimeout ( timeout ) ; context . setLockToken ( lockToken . getToken ( ) ) ; // Send the request to the server .
IResponse response = null ; try { response = davClient . lock ( locator , context , null ) ; examineResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Remove the properties with the given names , from this resource .
 * @ param propertyNames < code > Enumeration < / code > over
 * < code > QualifiedNames < / code >
 * @ exception DAVException if there was a problem removing the
 * properties
 * @ see IServer # proppatch ( Locator , Context , Document ) */
public void removeProperties ( Collection propertyNames ) throws DAVException { } }

implementation:
Assert . isNotNull ( propertyNames ) ; // Removing no properties is easy .
if ( propertyNames . isEmpty ( ) ) return ; // Add the names of the properties to remove to the request body .
Document document = newDocument ( ) ; PropertyUpdate propertyUpdate = PropertyUpdate . create ( document ) ; Prop prop = propertyUpdate . addRemove ( ) ; Iterator namesItr = propertyNames . iterator ( ) ; while ( namesItr . hasNext ( ) ) prop . addPropertyName ( ( QualifiedName ) namesItr . next ( ) ) ; // Send the PROPPATCH request .
IResponse response = null ; try { response = davClient . proppatch ( locator , newContext ( ) , document ) ; examineResponse ( response ) ; examineMultiStatusResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Remove the property with the given name from this resource .
 * @ param propertyName the name of the property to remove
 * @ exception DAVException if there was a problem removing the property
 * @ see # removeProperties ( Collection ) */
public void removeProperty ( QualifiedName propertyName ) throws DAVException { } }

implementation: Collection propertyNames = new Vector ( 1 ) ; propertyNames . add ( propertyName ) ; removeProperties ( propertyNames ) ;


signature:
public class AbstractResourceHandle { /** * Set the content of this resource to be the data stored in the given
 * input stream . The type encoding is given in the content type argument , and
 * should be in the media format described by RFC2616 Sec 3.7.
 * The stream will automatically be closed after the data
 * is consumed . If the resource does not exist it is created with the
 * given content .
 * @ param contentType the media type for the data on the input stream .
 * @ param input the inputstream containing the resource contents .
 * @ exception DAVException if there was a problem setting the contents .
 * @ see IServer # put ( Locator , Context , InputStream ) */
public void setContent ( String contentType , InputStream input ) throws DAVException { } }

implementation: IResponse response = null ; try { IContext context = newContext ( ) ; context . setContentType ( contentType ) ; response = davClient . put ( locator , context , input ) ; examineResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Set the given properties on this resource .
 * @ param properties a < code > Collection < / code > of property < code > Element < / code > s .
 * @ exception DAVException if there was a problem setting the properties .
 * @ see IServer # proppatch ( Locator , Context , Document ) */
public void setProperties ( Collection properties ) throws DAVException { } }

implementation:
Assert . isNotNull ( properties ) ; // Setting no properties is a no - op .
if ( properties . isEmpty ( ) ) return ; // Build the request body to describe the properties to set .
Document document = newDocument ( ) ; PropertyUpdate propertyUpdate = PropertyUpdate . create ( document ) ; Prop prop = propertyUpdate . addSet ( ) ; Iterator propertiesItr = properties . iterator ( ) ; while ( propertiesItr . hasNext ( ) ) { Element element = ( Element ) propertiesItr . next ( ) ; try { prop . addProperty ( element ) ; } catch ( MalformedElementException exception ) { throw new SystemException ( exception ) ; } } // end - while
// Send the request to the server and examine the response for failures .
IResponse response = null ; try { response = davClient . proppatch ( locator , newContext ( ) , document ) ; examineResponse ( response ) ; examineMultiStatusResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Set the given property on this resource .
 * @ param property the property to set
 * @ exception DAVException if there was a problem setting the property
 * @ see # setProperties ( Collection ) */
public void setProperty ( Element property ) throws DAVException { } }

implementation: Collection properties = new Vector ( 1 ) ; properties . add ( property ) ; setProperties ( properties ) ;


signature:
public class AbstractResourceHandle { /** * Unlock this resource with the given lock token .
 * @ param token the lock token to remove from this resource
 * @ exception DAVException if there was a problem unlocking this resource
 * @ see IServer # unlock ( Locator , Context ) */
public void unlock ( LockToken token ) throws DAVException { } }

implementation:
// Send the lock token in the header of the request .
IContext context = newContext ( ) ; context . setLockToken ( "<" + token . getToken ( ) + ">" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
IResponse response = null ; try { response = davClient . unlock ( locator , context ) ; examineResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Perform an UPDATE on the receiver to set the version it
 * is based upon .
 * @ param version the < code > Locator < / code > of the version that
 * is the target of the update request .
 * @ throws DAVException if a problem occurs executing the update
 * on the WebDAV server . */
public void update ( ILocator version ) throws DAVException { } }

implementation: Document document = newDocument ( ) ; Update . createVersion ( document , version . getResourceURL ( ) ) ; IResponse response = null ; try { response = davClient . update ( locator , newContext ( ) , document ) ; examineResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Bring the receiver under version control . This means that
 * the receiver is replaced by a version - controlled resource .
 * Note that the client may send version control to a resource
 * that is already under version control with no adverse effects .
 * @ throws DAVException if a problem occurs bringing the
 * resource under version control . */
public void versionControl ( ) throws DAVException { } }

implementation: IResponse response = null ; try { response = davClient . versionControl ( locator , newContext ( ) , null ) ; examineResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Delete this resource from the repository , optionally succeeding
 * in the delete if the resource was not found on the server .
 * @ param mustExist if < code > true < / code > then the delete will
 * fail if the resource was not on the server at the time of the
 * delete request . If < code > false < / code > the delete will succeed if
 * there was no such resource to delete .
 * @ exception DAVException if there was a problem deleting
 * this resource .
 * @ see IServer # delete ( Locator , Context ) */
public void delete ( boolean mustExist ) throws DAVException { } }

implementation: IResponse response = null ; try { response = davClient . delete ( locator , newContext ( ) ) ; if ( ! mustExist && ( response . getStatusCode ( ) == IResponse . SC_NOT_FOUND ) ) return ; examineResponse ( response ) ; examineMultiStatusResponse ( response ) ; } catch ( IOException exception ) { throw new SystemException ( exception ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Check the given status code and throw a WebDAV
 * exception if the code indicates failure . If the code
 * is success , this method does nothing .
 * @ param code the status code to check .
 * @ param message the status message accompanying the code .
 * @ exception WebDAVException if the server returned an HTTP / WebDAV
 * error code ( i . e . , anything outside the 200 - series codes ) . */
protected void examineStatusCode ( int code , String message ) throws WebDAVException { } }

implementation: if ( code >= 300 && code <= 399 ) throw new RedirectionException ( code , message ) ; if ( code >= 400 && code <= 499 ) throw new ClientException ( code , message ) ; if ( code >= 500 && code <= 599 ) throw new ServerException ( code , message ) ;


signature:
public class AbstractResourceHandle { /** * Return a boolean value indicating whether or not this resource
 * exists on the server .
 * This implementation uses the HTTP HEAD method so the URL may or
 * may not exist in the DAV namespace . The DAV RESOURCE _ TYPE property
 * is NOT checked . < / p >
 * @ return boolean < code > true < / code > if the resource exists on the server
 * or < code > false < / code > otherwise .
 * @ exception DAVException if there was a problem checking for
 * existence . */
public boolean exists ( ) throws DAVException { } }

implementation:
// Test existance by issuing a HEAD request .
IResponse response = null ; try { response = davClient . head ( locator , newContext ( ) ) ; // If the resource was not found , then that answers the question .
if ( response . getStatusCode ( ) == IResponse . SC_NOT_FOUND ) return false ; // Otherwise check for errors .
examineResponse ( response ) ; // No problems by this point , so the resource is there and OK .
return true ; } catch ( IOException exception ) { throw new SystemException ( exception ) ; } finally { closeResponse ( response ) ; }


signature:
public class AbstractResourceHandle { /** * Check to see if the resource is a working resource .
 * The resource is a working resource if it has
 * & lt ; DAV : checked - out & gt ; and does not have & lt ; DAV : auto - checkout & gt ;
 * in the & lt ; DAV : supported - live - properties - set & gt ; . < / p >
 * @ return < code > true < / code > if the resource is a working resource
 * and < code > false < / code > otherwise .
 * @ throws DAVException if a problem occurs determining the state
 * of the resource . */
public boolean isWorkingResource ( ) throws DAVException { } }

implementation:
PropertyStatus propertyStat = getProperty ( DAV_SUPPORTED_LIVE_PROPERTY_SET ) ; // If the live - property - set is not supported , then the answer is ' no ' .
if ( propertyStat . getStatusCode ( ) == IResponse . SC_NOT_FOUND ) return false ; // If there was a problem getting the live property set , throw an exception .
examineStatusCode ( propertyStat . getStatusCode ( ) , propertyStat . getStatusMessage ( ) ) ; // Check to see if the required properties are / are not in the supported set .
try { Element propertySet = propertyStat . getProperty ( ) ; return ( ( ElementEditor . hasChild ( propertySet , DAV_CHECKED_OUT ) ) && ! ( ElementEditor . hasChild ( propertySet , DAV_AUTO_CHECKOUT ) ) ) ; } catch ( MalformedElementException exception ) { throw new SystemException ( exception ) ; }


signature:
public class AbstractResourceHandle { /** * This is a helper method to check to see if the resource has a
 * property with the given name that in turn has a child with a
 * given name .
 * @ return < code > true < / code > if the resource does have such a
 * property with a named child and < code > false < / code > if it does
 * not have such a property or does not have such a child of the
 * property .
 * @ throws DAVException if a problem occurs determining result
 * from the server . */
protected boolean propertyHasChild ( QualifiedName propertyName , QualifiedName childName ) throws DAVException { } }

implementation:
// If the property is not found , then the answer is ' no ' .
PropertyStatus propertyStat = getProperty ( propertyName ) ; if ( propertyStat . getStatusCode ( ) == IResponse . SC_NOT_FOUND ) return false ; // If there was a problem getting the property , throw an exception .
examineStatusCode ( propertyStat . getStatusCode ( ) , propertyStat . getStatusMessage ( ) ) ; // Check to see if the named child is in the retrieved property .
try { return ElementEditor . hasChild ( propertyStat . getProperty ( ) , childName ) ; } catch ( MalformedElementException exception ) { throw new SystemException ( exception ) ; }


signature:
public class Bindings { /** * Adds the specified binding to this editor ' s bindings element . The
 * given href and segment must not be < code > null < / code > .
 * @ param href the href part of the binding to add
 * @ param segment the segment part of the binding to add */
public void addBinding ( String href , String segment ) { } }

implementation:
Assert . isNotNull ( href ) ; Assert . isNotNull ( segment ) ; appendChild ( root , "href" , encodeHref ( href ) ) ; // $ NON - NLS - 1 $
appendChild ( root , "segment" , segment ) ; // $ NON - NLS - 1 $