org.eclipse.wst.jsdt.chromium.util

## Class JavaScriptExpressionBuilder

- java.lang.Object
- - org.eclipse.wst.jsdt.chromium.util.JavaScriptExpressionBuilder

    public class JavaScriptExpressionBuilder
    extends java.lang.Object

Helps to build fully qualified name for variable. Fully qualified name should be a JavaScript expression that allows to calculate this variable directly (assuming that all involved operations always return the same values). This is basically about building expression for an inner property of some object.

A full path from the variable back to the root object must be provided. The SDK doesn't keep it, it's a user responsibility to save the path.

### Nested Class Summary

Nested Classes
`static interface` `JavaScriptExpressionBuilder.ExpressionComponentFormatter` Defines how the last component of qualified name should be built.
`static interface` `JavaScriptExpressionBuilder.VariableAccess` Makes an input for the qualified name builder.

### Field Summary

Fields
`static java.util.regex.Pattern` `KEY_NOTATION_PROPERTY_NAME_PATTERN` A simplified pattern that checks whether dot notation could be used in the property accessor.
`static JavaScriptExpressionBuilder.ExpressionComponentFormatter` `OBJECT_PROPERTY_NAME_BUILDER` Formats a variable as a property of some other object.
`static java.util.Collection<java.lang.String>` `SEMI_INTERNAL_PROPERTY_NAMES` A collection of non-normative property names that still could be used as a regular property in expressions.
`static JavaScriptExpressionBuilder.ExpressionComponentFormatter` `SHORT_NAME` Formats a variable as fully described by its short name.
`static JavaScriptExpressionBuilder.ExpressionComponentFormatter` `SHORT_NAME_PAREN` Formats a variable as fully described by its short name.

### Constructor Summary

Constructors
Constructor and Description
`JavaScriptExpressionBuilder()`

### Method Summary

All Methods Static Methods Concrete Methods
`static java.lang.String` `buildQualifiedName(JavaScriptExpressionBuilder.VariableAccess variableAccess)` Builds fully qualified name for a variable.
`static boolean` `checkArrayIndexValue(long l)`
`static java.lang.Long` `parsePropertyNameAsArrayIndex(java.lang.String propertyName)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### SHORT_NAME

    public static final JavaScriptExpressionBuilder.ExpressionComponentFormatter SHORT_NAME

Formats a variable as fully described by its short name. Parent variable isn't used.

#### SHORT_NAME_PAREN

    public static final JavaScriptExpressionBuilder.ExpressionComponentFormatter SHORT_NAME_PAREN

Formats a variable as fully described by its short name. Parent variable isn't used. If the variable itself used as a parent, its name will be closed in parentheses.

#### OBJECT_PROPERTY_NAME_BUILDER

    public static final JavaScriptExpressionBuilder.ExpressionComponentFormatter OBJECT_PROPERTY_NAME_BUILDER

Formats a variable as a property of some other object. Property access will be formatter in dot notation if its name allows, otherwise in bracket notation.

#### KEY_NOTATION_PROPERTY_NAME_PATTERN

    public static final java.util.regex.Pattern KEY_NOTATION_PROPERTY_NAME_PATTERN

A simplified pattern that checks whether dot notation could be used in the property accessor. Allows rare false negatives.

#### SEMI_INTERNAL_PROPERTY_NAMES

    public static final java.util.Collection<java.lang.String> SEMI_INTERNAL_PROPERTY_NAMES

A collection of non-normative property names that still could be used as a regular property in expressions.

### Constructor Detail

#### JavaScriptExpressionBuilder

    public JavaScriptExpressionBuilder()

### Method Detail

#### buildQualifiedName

    public static java.lang.String buildQualifiedName(JavaScriptExpressionBuilder.VariableAccess variableAccess)

Builds fully qualified name for a variable. The input is a variable, wrapped as `JavaScriptExpressionBuilder.VariableAccess`, that provides a path back to the root object.

#### parsePropertyNameAsArrayIndex

    public static java.lang.Long parsePropertyNameAsArrayIndex(java.lang.String propertyName)

#### checkArrayIndexValue

    public static boolean checkArrayIndexValue(long l)