diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-07-17 18:07:43 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-07-17 18:09:00 +0200 |
commit | 84d017e27047042c2299110fe08302840c45320d (patch) | |
tree | c5dab81349178346d6839f4b6ebe2c49b098790b | |
parent | 9d1dc93f1dd5334406231fcef46999dedc2b2e68 (diff) | |
download | lombok-84d017e27047042c2299110fe08302840c45320d.tar.gz lombok-84d017e27047042c2299110fe08302840c45320d.tar.bz2 lombok-84d017e27047042c2299110fe08302840c45320d.zip |
Features are now 'compiled' by the build.xml script to include the snippets, found in the usage_examples directory. Also worked on the styling of the feature pages.
-rw-r--r-- | build.xml | 77 | ||||
-rw-r--r-- | website/features/GetterSetter.html | 36 | ||||
-rw-r--r-- | website/features/features.css | 42 |
3 files changed, 147 insertions, 8 deletions
@@ -48,11 +48,82 @@ <delete dir="dist" quiet="true" /> </target> + <target name="website"> + <mkdir dir="build/website" /> + <copy todir="build/website"> + <fileset dir="website"> + <exclude name="**/*.jpage" /> + <exclude name="**/*.svg" /> + <exclude name="**/*.psd" /> + <exclude name="**/*.ai" /> + <exclude name="**/*unused*" /> + </fileset> + </copy> + <antcall target="-integrateSnippet"> + <param name="transformationName" value="GetterSetter" /> + </antcall> +<!-- + <antcall target="-integrateSnippet"> + <param name="transformationName" value="Data" /> + </antcall> +--> + </target> + + <target name="-integrateSnippet"> + <mkdir dir="build/website" /> + <property name="prefile" location="usage_examples/${transformationName}Example_pre.jpage" /> + <property name="postfile" location="usage_examples/${transformationName}Example_post.jpage" /> + <property name="htmlfile" location="website/features/${transformationName}.html" /> + <mkdir dir="build/temp" /> + <property name="preout" location="build/temp/pre.html" /> + <property name="postout" location="build/temp/post.html" /> + <java jar="deps/build/java2html.jar" fork="true"> + <arg value="-srcfile" /> + <arg value="${prefile}" /> + <arg value="-targetfile" /> + <arg value="${preout}" /> + <arg line="-style Eclipse -converter html -tabs 4" /> + </java> + <java jar="deps/build/java2html.jar" fork="true"> + <arg value="-srcfile" /> + <arg value="${postfile}" /> + <arg value="-targetfile" /> + <arg value="${postout}" /> + <arg line="-style Eclipse -converter html -tabs 4" /> + </java> + <loadfile property="pre" encoding="UTF-8" srcFile="${preout}"> + <filterchain> + <linecontainsregexp> + <regexp pattern="(code>)|(font>)" /> + </linecontainsregexp> + </filterchain> + </loadfile> + <loadfile property="post" encoding="UTF-8" srcFile="${postout}"> + <filterchain> + <linecontainsregexp> + <regexp pattern="(code>)|(font>)" /> + </linecontainsregexp> + </filterchain> + </loadfile> + <delete dir="build/temp" quiet="true" /> + <copy file="${htmlfile}" todir="build/website/features" overwrite="true"> + <filterchain> + <replacetokens> + <token key="HTML_PRE" value="${pre}" /> + <token key="HTML_POST" value="${post}" /> + </replacetokens> + </filterchain> + </copy> + </target> + <target name="compile"> <mkdir dir="build/lombok" /> - <!-- This version trickery is so that an eclipse running in a JVM 1.5 will run properly (It'll never touch the javac files and hence never trigger a Bad Class Version Number error - but for javac we definitely cannot support javac 1.5, partly because they completely rewrote large swaths of javac, and partly because our injection mechanism (annotations) - doesn't work very well on javac 1.5, hence, when using javac, we do demand you're on 1.6. --> + <!-- This version trickery is so that an eclipse running in a JVM 1.5 will run + properly (It'll never touch the javac files and hence never trigger a + Bad Class Version Number error, but for javac we definitely cannot support + javac 1.5, partly because they completely rewrote large swaths of javac, + and partly because our injection mechanism (annotations) doesn't work very + well on javac 1.5, hence, when using javac, we do demand you're on 1.6. --> <javac srcdir="src" debug="on" destdir="build/lombok" target="1.5" excludes="lombok/javac/**"> <classpath refid="lombok.deps.path" /> <classpath refid="lombok.libs.path" /> diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html index 246a8eab..d8ffbb6a 100644 --- a/website/features/GetterSetter.html +++ b/website/features/GetterSetter.html @@ -1,8 +1,6 @@ <!DOCTYPE html> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="../logi/jQuery-all.js" type="text/javascript"></script> - <script src="features.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> <link rel="stylesheet" type="text/css" href="features.css" /> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> @@ -15,6 +13,40 @@ <div class="header"><a href="../index.html">Project Lombok</a></div> <h1>@Getter and @Setter</h1> <div class="overview"> + <h3>Overview</h3> + <p> + You can annotate any field with <code>@Getter</code> and/or <code>@Setter</code>, to let lombok generate the default getter/setter automatically.<br /> + A default getter simply returns the field, and is named <code>getFoo</code> if the field is called <code>foo</code> (or <code>isFoo</code>) + if the field's type is <code>boolean</code>. A default setter is named <code>setFoo</code> if the field is called <code>foo</code>, returns <code>void</code>, + and takes 1 parameter of the same type as the field. It simply sets the field to this value. + </p><p> + The generated getter/setter method will be <code>public</code> unless you explicitly specify an <code>AccessLevel</code>, as shown in the example below. + Legal access levels are <code>PUBLIC</code>, <code>PROTECTED</code>, <code>PACKAGE</code>, and <code>PRIVATE</code>. + </p> + <h3>Small print</h3><div class="smallprint"> + <p> + For generating the method names, the first character of the field, if it is a lowercase character, is title-cased, otherwise, it is left unmodified. + Then, get/set/is is prefixed. + </p><p> + No method is generated if any method already exists with the same name, even if the parameter list is different. For example, <code>getFoo()</code> + will not be generated if there's already a method <code>getFoo(int x)</code> even though it is technically possible to make the method. This caveat + exists to prevent confusion. If the generation of a method is skipped for this reason, a warning is emitted instead. + </p><p> + Any variation on <code>boolean</code> will <em>not</em> result in using the <code>is</code> prefix instead of the <code>get</code> prefix; for example, + returning <code>java.lang.Boolean</code> results in a <code>get</code> prefix, not an <code>is</code> prefix. + </p> + </div> + </div> + <div class="snippets"> + <div class="pre"> + <h3>With Lombok</h3> + <div class="snippet">@HTML_PRE@</div> + </div> + <div class="sep"></div> + <div class="post"> + <h3>Vanilla Java</h3> + <div class="snippet">@HTML_POST@</div> + </div> </div> <footer> <a href="features.html">Back to features</a> | <span class="disabled">Previous feature</span> | <a href="Data.html">Next feature (@Data)</a><br /> diff --git a/website/features/features.css b/website/features/features.css index e7bbdeca..98446bd8 100644 --- a/website/features/features.css +++ b/website/features/features.css @@ -25,7 +25,7 @@ body { .meat .minimumHeight { height: 700px; width: 5px; - float: left; + float: right; } h1 { @@ -33,9 +33,45 @@ h1 { text-align: center; } +.snippets { + margin-top: 32px; +} + +.snippets .pre { + float: left; + width: 45%; +} + +.snippet { + overflow: auto; + padding: 4px; + border: 1px dotted #888; +} + +.snippets .sep { + display: block; + width: 5%; + height: 1px; + float: left; +} + +.snippets .post { + float: left; + width: 45%; +} + +.snippets .end { + clear: both; +} + +.snippet code { + font-size: 14px; +} + footer { - margin: 64px auto 0 auto; - padding-bottom: 16px; + clear: left; + margin: 0 auto 0 auto; + padding: 16px 0 16px 0; display: block; text-align: center; } |