Package com._1c.g5.v8.dt.debug.util
Class DebugNodeModelUtils
- java.lang.Object
-
- com._1c.g5.v8.dt.debug.util.DebugNodeModelUtils
-
public final class DebugNodeModelUtils extends Object
Node model BSL-specific utility class. Contains utility methods for 1C:Enterprise Runtime debug process purposes.- Restriction:
- This class is not intended to be sub-classed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
belongToMethod(org.eclipse.emf.ecore.EObject variable, Method method)
Returns whether the given variable belong to the given method.static Method
getLineMethod(Module module, int line)
Returns method of module by line number, ornull
, if there isn't one.static String
getModuleResourceContent(Module module)
Returns module resource content.static int
getModuleResourceLine(Module module, int offset)
Compute module resource line number by the given offset.static int
getModuleResourceOffset(Module module, int line)
Compute module resource offset by line number.static int
getValidModuleResourceOffset(Module module, int line)
Compute valid module resource offset of module by the line number.static boolean
isElementBeforeOffset(org.eclipse.emf.ecore.EObject element, int offset)
Returns whether the given element is before the given offset.
-
-
-
Method Detail
-
getModuleResourceOffset
public static int getModuleResourceOffset(Module module, int line)
Compute module resource offset by line number.Returns the first node offset with line number equals or greater than the given. If there aren't nodes with that line number, method will return offset of last module node.
- Parameters:
module
- the BSL module, cannot benull
line
- the line number- Returns:
- module the resource offset
-
getValidModuleResourceOffset
public static int getValidModuleResourceOffset(Module module, int line)
Compute valid module resource offset of module by the line number.If given line of module begins with
Function ...
method will return the offset after entire method declaration. Otherwise method will return#getModuleResourceOffset(Resource, int)
result.- Parameters:
module
- the BSL module, cannot benull
line
- the line number- Returns:
- a valid module resource offset
-
getModuleResourceLine
public static int getModuleResourceLine(Module module, int offset)
Compute module resource line number by the given offset.Returns first node line number with offset equals or greater than given. If there aren't nodes with that offset, method will return line number of last module node.
- Parameters:
module
- the BSL module, cannot benull
offset
- the offset- Returns:
- the line number
-
getModuleResourceContent
public static String getModuleResourceContent(Module module)
Returns module resource content. Returns content asString
.- Parameters:
module
- the BSL module to get content for, cannot benull
- Returns:
- the content of resource as
String
, nevernull
-
getLineMethod
public static Method getLineMethod(Module module, int line)
Returns method of module by line number, ornull
, if there isn't one.- Parameters:
module
- the BSL module, cannot benull
line
- line number of module- Returns:
- method by given line number, can be
null
-
belongToMethod
public static boolean belongToMethod(org.eclipse.emf.ecore.EObject variable, Method method)
Returns whether the given variable belong to the given method.- Parameters:
variable
- the variable, cannot benull
method
- the method, cannot benull
- Returns:
- whether the given variable belong to given method
-
isElementBeforeOffset
public static boolean isElementBeforeOffset(org.eclipse.emf.ecore.EObject element, int offset)
Returns whether the given element is before the given offset.- Parameters:
element
- the element, cannot benull
offset
- the offset- Returns:
- whether the given element is before offset
-
-