Class: YieldDeclaration

YieldDeclaration

new YieldDeclaration(parsingElement, contentAreaType)

The YieldDeclaration class holds the name of the yield-declaration (which is a place-holder for the contentFor-fields and is used in the layouts: content, header, footer, dialogs, ...) and its starting and ending position within the content-definition.
Name Type Description
parsingElement Object with properties name {String}, start {Integer}, end {Integer}
contentAreaType Integer the type of the content area within the layout that this yield-declaration refers to (e.g. ViewConstants.CONTENT_AREA_BODY ) borrows the getValue function from ParsingResult:

Requires

  • module:mmir.parser.ParsingResult#getValue

Members

getValue

Get the value for property name with the proper type (as specified by nameType). This may be neccessary, if the nameType is not e.g. STRING but a VARIABLE, in which case name does not reference the value itself, but the name for the variable This is a shortcut to the function mobileDS.parser.ParsingResult.prototype.getValue I.e. for YieldDeclration yield with a nameType of VARIABLE, to not use: yield.getName() but yield.getValue(yield.getName(), yield.getNameType(), theRenderingData) where theRenderingData is an object that contains a property from which the variable value can be retrieved, i.e. where theRenderingData[yield.getName()] contains the YieldDeclaration's name.

Methods

getAreaType(){Integer}

Gets the type of the content area that this mmir.YieldDeclaration object refers to (i.e. "areas" in the layout, e.g. bodyContents, dialogsContent).
Returns:
area type (see mmir.Layout, e.g. ViewConstants.CONTENT_AREA_BODY)

getEnd(){Integer}

Gets the end position (index) of a mmir.YieldDeclaration object.
Returns:
position of the Yield within the content (e.g. the bodyContent or the dialogsContent)
Gets the name of a mmir.YieldDeclaration object (e.g. content, header, footer, dialogs, ...).
Returns:
- used by yield tags in layout

getStart(){Integer}

Gets the start position (index) of a mmir.YieldDeclaration object.
Returns:
position of the Yield within the content (e.g. the bodyContent or the dialogsContent)