Class: VirtualPath

baja. VirtualPath


new VirtualPath()

Resolves Virtual Slot Paths.

Extends

Methods


<static> isValidName(nm)

Return whether the slot name is valid.

Parameters:
Name Type Description
nm String

the name to validate.

Returns:

true if the slot name is valid.

Type
Boolean

<static> toSlotPathName(virtualPathName)

Converts the given VirtualPath name to a valid SlotPath name. This method will unescape any
unsupported virtual characters ('/', '|', '$', ':', and the '~' escape character itself) in the
given VirtualPath name that were previously escaped using the '~' escape character. It will
also ensure that the result is in proper SlotPath escaped form before returning it.

In order to support legacy uses of the '~' escape character in pre-4.6 VirtualPath names,
this method will only consider '~' as an escape character if it is followed by the code for
one of the unsupported virtual characters ('/', '|', '$', ':', and the '~' escape character
itself) in the given VirtualPath name.

Parameters:
Name Type Description
virtualPathName String

The VirtualPath name to be converted to a valid SlotPath name.

Since:
  • Niagara 4.6
See:
Returns:

A valid SlotPath name.

Type
String

<static> toVirtualPathName(slotPathName)

Converts the given SlotPath name to a valid VirtualPath name. The SlotPath name argument
must be in its proper slot escaped form - don't call SlotPath.unescape() on the SlotPath name
argument before calling this method. This method will unescape the given SlotPath name and
look for any unsupported virtual characters ('/', '|', '$', ':', and the '~' escape character
itself) and escape those using the '~' escape character.

Parameters:
Name Type Description
slotPathName String

The SlotPath name to be converted to a valid VirtualPath name.
This argument must be in its proper slot escaped form - don't call SlotPath.unescape() on this
SlotPath name argument before passing it to this method.

Since:
  • Niagara 4.6
See:
Returns:

A valid VirtualPath name where any unsupported virtual characters have been
escaped using the '~' escape character.

Type
String

depth()

Return the SlotPath depth.

Inherited From:
Returns:

the SlotPath depth.

Type
Number

equals(obj)

Indicates whether some other object is equal to this one.

Parameters:
Name Type Description
obj Object

the reference object with which to compare.

Inherited From:
Returns:

true if this object is the same as the obj argument; false otherwise.

Type
Boolean

getBackupDepth()

Return the SlotPath backup depth.

Inherited From:
Returns:

the SlotPath depth.

Type
Number

getBody()

Return the body for the query.

Inherited From:
Returns:
Type
String

getNames()

Return all of the names for this SlotPath

Inherited From:
Returns:

the names

Type
Array.<String>

getScheme()

Return the scheme used with this SlotPath.

Overrides:
Returns:
Type
baja.VirtualScheme

getSchemeName()

Return the scheme name for the SlotPath.

Overrides:
Returns:
Type
String

isAbsolute()

Return true if the SlotPath is absolute.

Inherited From:
Returns:

true if the SlotPath is absolute.

Type
Boolean

isHost()

Return true if the Query is a Host.

Inherited From:
Returns:
Type
Boolean

isSession()

Return true if the Query is a Session.

Inherited From:
Returns:
Type
Boolean

isValidPathName(pathName)

Return whether the specified path name is valid.

Parameters:
Name Type Description
pathName String

the path name to validate.

Overrides:
Returns:

true if the slot name is valid.

Type
Boolean

merge(a)

Merge this path with the specified path.

Parameters:
Name Type Description
a baja.SlotPath
Inherited From:
Returns:

the body of the SlotPath.

Type
String

nameAt(depth)

Return the name at the given depth.

Parameters:
Name Type Description
depth Number

the specified depth for the name.

Inherited From:
Returns:

the name at the specified depth.

Type
String

toString()

Return a String representation of the query.

Inherited From:
Returns:
Type
String

valueOf()

Return the inner value of the object.

By default the object's instance is returned.

Inherited From:
Returns:

the inner value of the object or just the object's instance.

Type
*