Created
October 6, 2014 14:05
-
-
Save neilellis/54028c78541e53d404d8 to your computer and use it in GitHub Desktop.
Piping in Dollar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.cazcade.dollar.pipe; | |
| import com.cazcade.dollar.Script; | |
| import com.cazcade.dollar.var; | |
| import java.util.Date; | |
| /** | |
| * @author <a href="http://uk.linkedin.com/in/neilellis">Neil Ellis</a> | |
| */ | |
| public class FirstScript extends Script { | |
| static { | |
| $THIS = FirstScript.class; | |
| } | |
| { | |
| var profile = $("name", "Neil") | |
| .$("age", new Date().getYear() + 1900 - 1970) | |
| .$("gender", "male") | |
| .$("projects", $jsonArray("snapito", "dollar_vertx")) | |
| .$("location", | |
| $("city", "brighton") | |
| .$("postcode", "bn1 6jj") | |
| .$("number", 343) | |
| ); | |
| profile.pipe(ExtractName.class).pipe(WelcomeMessage.class).out(); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it is all valid Java, see :- https://github.com/cazcade/dollar