ArchFilterClauseContainer(clauseOperator)

new ArchFilterClauseContainer(clauseOperator)

Creates a filter clause container class. This class holds filter clauses or filter clause containers and provides and'ing / or'ing functionality when performing filtering operations.

Parameters:
Name Type Description
clauseOperator string

JSON for initial configuration.

See:

Extends

Members

static, readonly displayTypeName :string

Returns the display type name string 'ArchFilterClauseContainer'.

readonly isArchBaseFilterMatching :boolean

Returns true indicating that this is an ArchBaseObjectFilterCommon instance.

Overrides:

readonly isArchFilterClauseContainer :boolean

Returns true indicating that this is an ArchFilterClauseContainer instance.

readonly logStr :string

This is a string suitable for logging information about this object which is generated by the Architect Scripting object itself. Usually this contains stuff like the tracking ID, name, type information, etc. etc. This information will be used as the header for actual logging calls.

Overrides:

readonly logStrTypeOnly :string

This is a string suitable for logging information about this object where it's just the object's type. This is normally used when logging errors that occur in constructor parameter checking because the scripting object isn't set up and the normal logging str contents wouldn't be set up.

Overrides:

operator :string

The operator that will be used when ArchBaseObjectFilterCommon#isMatch is called on this container and indicates whether or not to use and'ing or or'ing on the contents of this container for the isMatch processing. The string values in ArchEnums#FILTER_CONTAINER_OPERATORS list valid values.

Methods

addClausePropertyCallback(propertyName, callbackFunction, propertyMustExistopt) → {ArchFilterClausePropertyCallback}

This method will add a property value callback filter clause to this filter component. Your callback function will be called with the property value, name and containing object where you can determine if it should be considered a match. If propertyMustExist is true and the named property does not exist on the object, evaluation of this clause will return false. For example, this is a nice method to use if you wanted to case insensitively check the name on something to see if its string value should be considered a match.

Parameters:
Name Type Attributes Default Description
propertyName string

the property name to check on the ArchBaseObject instance. The named property must exist on the object in order for the equals check to be made.

callbackFunction callbackFilterClauseProperty

the function to call to determine if there is a match.

propertyMustExist boolean <optional>
true

whether or not the property must exist on the object for the callback to be made for match processing. If the named property does not exist and propertyMustExist is true then evaluation of this clause will not be a match.

addClausePropertyValueEquals(propertyName, valueopt, propertyMustExistopt) → {ArchFilterClausePropertyValueEquals}

This method will add a basic property value equality filter clause to this filter container. It can be used to check to see if a property value on an ArchBaseObject instance is equal to the supplied value for matching. If propertyMustExist is set to true and the named property does not exist on the object, evaluation of this clause will return false. Equality checking is done using the JavaScript === operator with the supplied value. If you wish to have more control over inequality checking or property checking in general, please use the ArchFilterClauseContainer#addClausePropertyCallback method where you can specify a callback function to perform your own match logic.

Parameters:
Name Type Attributes Default Description
propertyName string

the property name to check on the ArchBaseObject instance. The named property must exist on the object in order for the equals check to be made.

value any <optional>

the value of the property you wish to check.

propertyMustExist boolean <optional>
true

whether or not the property must exist on the object for the equality check to be made when evaluating this clause. If the named property does not exist on the object being and propertyMustExist is true then evaluation of this clause will not be a match.

addClausePropertyValueNotEquals(propertyName, valueopt, propertyMustExistopt) → {ArchFilterClausePropertyValueNotEquals}

This method will add a basic property value inequality filter clause to this filter component. It can be used to check to see if a property value on an ArchBaseObject instance is not equal to the supplied value for matching. If propertyMustExist is true and the named property does not exist on the object, evaluation of this clause will return false. Inequality checking is done using the JavaScript !== operator with the supplied value. If you wish to have more control over inequality checking or property checking in general, please use the ArchFilterClauseContainer#addClausePropertyCallback method where you can specify a callback function to perform your own match logic.

Parameters:
Name Type Attributes Default Description
propertyName string

the property name to check on the ArchBaseObject instance. The named property must exist on the object in order for the equals check to be made.

value any <optional>

the value of the property you wish to check.

propertyMustExist boolean <optional>
true

whether or not the property must exist on the object for the inequality check to be made when evaluating this clause. If the named property does not exist on the object being and propertyMustExist is true then evaluation of this clause will not be a match.

addFilterClauseContainer(operatoropt) → {ArchFilterClauseContainer}

This method adds a new filter clause container to this container and returns the new clause container. This is normally done when you want to do nested and'ing and/or or'ing.

Parameters:
Name Type Attributes Description
operator string <optional>

when performing match checks, this specifies whether or not to and or or match results from contained filter clauses or filter clause containers. If not specified, the default value for this is ArchEnums.FILTER_CONTAINER_OPERATORS.and. The string values in ArchEnums#FILTER_CONTAINER_OPERATORS lists valid operator values.

isFilterMatch(archFilterObject) → {boolean}

Returns whether or not this Architect Scripting object is a match for the supplied ArchFilterObject instance.

Parameters:
Name Type Description
archFilterObject ArchFilterObject

the object filter to use to determine if it's a match.

Returns:
boolean
Overrides:

isMatch(archBaseObjectToCheck) → {boolean}

This function returns whether or not the supplied ArchBaseObject instance is a match for the inheriting filter object type. For the ArchFilterClauseContainer class, which you'll note that ArchFilterObject inherits from too, if there are no filter clauses in them the isMatch handling will return true.

Parameters:
Name Type Description
archBaseObjectToCheck ArchBaseObject

the ArchBaseObject instance you wish to check to see if it's a match.

Returns:
boolean
Overrides:

logError(errorStr)

Logs an error to the logging service with a log header from this object's logStr property value when ArchLogging#logErrors is true.

Parameters:
Name Type Description
errorStr string

the error string to log.

Overrides:

logErrorAndThrow(errorStr)

Logs an error to the logging service with a log header from this object's logStr property value when ArchLogging#logErrors is true and then throws the string in the errorStr parameter.

Parameters:
Name Type Description
errorStr string

the error string to log. This should be a non-blank string.

Throws:
  • Throws the submitted error string.
Overrides:

logNote(noteStr)

Logs a note to the logging service with a log header from this object's logStr property value when ArchLogging#logNotes is true.

Parameters:
Name Type Description
noteStr string

the note string to log. This should be a non-blank string.

Overrides:

logNoteVerbose(noteStr)

Logs a note to the logging service with a log header from this object's logStr property value when ArchLogging#logNotesVerbose is true.

Parameters:
Name Type Description
noteStr string

the note string to log. This should be a non-blank string.

Overrides:

logWarning(warningStr)

Logs a warning to the logging service with a log header from this object's logStr property value when ArchLogging#logWarnings is true.

Parameters:
Name Type Description
warningStr string

the warning string to log. This should be a non-blank string.

Overrides: