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
namewith the proper type (as specified bynameType). This may be neccessary, if the nameType is not e.g. STRING but a VARIABLE, in which casenamedoes 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:butyield.getName()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.YieldDeclarationobject refers to (i.e. "areas" in the layout, e.g. bodyContents, dialogsContent).Returns:
area type (seemmir.Layout, e.g. ViewConstants.CONTENT_AREA_BODY)
-
getEnd(){Integer}
-
Gets the end position (index) of a
mmir.YieldDeclarationobject.Returns:
position of the Yield within the content (e.g. the bodyContent or the dialogsContent)
-
getName(){String}
-
Gets the name of a
mmir.YieldDeclarationobject (e.g. content, header, footer, dialogs, ...).Returns:
- used by yield tags in layout
-
getStart(){Integer}
-
Gets the start position (index) of a
mmir.YieldDeclarationobject.Returns:
position of the Yield within the content (e.g. the bodyContent or the dialogsContent)