diff options
Diffstat (limited to 'plugins/org.eclipse.xtend.util.stdlib/src/org/eclipse/xtend/util/stdlib/tracing.ext')
-rw-r--r-- | plugins/org.eclipse.xtend.util.stdlib/src/org/eclipse/xtend/util/stdlib/tracing.ext | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/plugins/org.eclipse.xtend.util.stdlib/src/org/eclipse/xtend/util/stdlib/tracing.ext b/plugins/org.eclipse.xtend.util.stdlib/src/org/eclipse/xtend/util/stdlib/tracing.ext index 84d8998a..7c8fec24 100644 --- a/plugins/org.eclipse.xtend.util.stdlib/src/org/eclipse/xtend/util/stdlib/tracing.ext +++ b/plugins/org.eclipse.xtend.util.stdlib/src/org/eclipse/xtend/util/stdlib/tracing.ext @@ -1,24 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2005-2009 itemis AG (http://www.itemis.eu) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ + extension org::eclipse::xtend::util::stdlib::naming; extension org::eclipse::xtend::util::stdlib::io; extension org::eclipse::xtend::util::stdlib::issues; +/** + * Creates a trace between two elements. + * @param from Source element + * @param to Target element. + * @param kind Name for the trace from source to target. + * @param backKind Name for the trace from target back to source. + */ Void createTrace( Object from, Object to, String kind, String backKind ): createTrace( from, to, kind ) -> createTrace( to, from, backKind ); +/** + * Creates a trace between two elements. + * @param from Source element + * @param to Target element. + * @param kind Name for the trace. + */ Void createTrace( Object from, Object to, String kind ): JAVA org.eclipse.xtend.util.stdlib.TraceComponent.createTrace(java.lang.Object, java.lang.Object, java.lang.String); -Void clearTrace(Object ctx): - JAVA org.eclipse.xtend.util.stdlib.TraceComponent.clearTrace(java.lang.Object); +/** + * Clears all traces. + */ +Void clearTrace(): + JAVA org.eclipse.xtend.util.stdlib.TraceComponent.clearTrace(); +/** + * Finds the target of a trace. This function will report an error if no trace for the source + * element to the target of the specified kind can be found. + * @param from Source element. + * @param kind Trace kind name. + * @return The target element of that trace. + */ Object getSingleTraceTarget( Object from, String kind ): let t = getTargetInternal(from, kind): t != null ? t : reportError("cannot find a "+kind+" trace for "+from.qualifiedName() ); +/** + * Proves if a trace of a specific kind exists for some element. + * @param from Some model element. + * @param kind Name of the trace. + * @return true, if a trace of that kind exists for the element. + */ boolean hasTrace( Object from, String kind ): getTargetInternal(from, kind) != null; + +// -------------------------------- INTERNAL -------------------------------- + + + private Object getTargetInternal( Object from, String kind ): JAVA org.eclipse.xtend.util.stdlib.TraceComponent.getSingleTraceTarget(java.lang.Object, java.lang.String);
\ No newline at end of file |