JaroslavTulach at 06:45, 20 June 2016 - 2016-06-20 06:45:14

←Older revision Revision as of 06:45, 20 June 2016
Line 3: Line 3:
An example of [[HiddenBuilder]] can be found at [[Truffle]] [[API]]. There is {{truffle|com/oracle/truffle/api/vm|PolyglotEngine.Builder}} which constructs instances of {{truffle|com/oracle/truffle/api/vm|PolyglotEngine}}, but if you look at overall [[Truffle]] [[javadoc]], the [[builder]] isn't visible in the {{truffle|com/oracle/truffle/api/vm|package-summary}} overview.
An example of [[HiddenBuilder]] can be found at [[Truffle]] [[API]]. There is {{truffle|com/oracle/truffle/api/vm|PolyglotEngine.Builder}} which constructs instances of {{truffle|com/oracle/truffle/api/vm|PolyglotEngine}}, but if you look at overall [[Truffle]] [[javadoc]], the [[builder]] isn't visible in the {{truffle|com/oracle/truffle/api/vm|package-summary}} overview.
-
[[TBD]]: Explain why.
+
The trick is to make the builder a non-static inner class (see [https://github.com/graalvm/truffle/blob/2dacd8599f40e31cb1ff2232264d664564880959/truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/PolyglotEngine.java#L257 the code]) - then it isn't listed in the [[Javadoc]] classes overview.
 +
 
 +
[[Category:APIDesignPatterns]]
 +
[[Category:APIDesignPatterns:Creational]]

JaroslavTulach at 06:41, 20 June 2016 - 2016-06-20 06:41:57

←Older revision Revision as of 06:41, 20 June 2016
Line 1: Line 1:
[[HiddenBuilder]] is a trick that hides the [[builder]] from [[Javadoc]] of your [[API]]. It may be very handy when the builder comes with a complex (generic type) signature like in case of [[ResistingBuilder]].
[[HiddenBuilder]] is a trick that hides the [[builder]] from [[Javadoc]] of your [[API]]. It may be very handy when the builder comes with a complex (generic type) signature like in case of [[ResistingBuilder]].
-
An example of [[HiddenBuilder]] can be found at [[Truffle]] [[API]]. There is {{truffle|com/oracle/truffle/api/vm|PolyglotEngine.Builder}} which constructs instances of {{truffle|com/oracle/truffle/api/vm|PolyglotEngine}}, but if you look at overall [[Truffle]] [[javadoc]], the [[builder]] isn't visible in the {{truffle|com/oracle/truffle/api/vm|package-overview}} list of classes.
+
An example of [[HiddenBuilder]] can be found at [[Truffle]] [[API]]. There is {{truffle|com/oracle/truffle/api/vm|PolyglotEngine.Builder}} which constructs instances of {{truffle|com/oracle/truffle/api/vm|PolyglotEngine}}, but if you look at overall [[Truffle]] [[javadoc]], the [[builder]] isn't visible in the {{truffle|com/oracle/truffle/api/vm|package-summary}} overview.
[[TBD]]: Explain why.
[[TBD]]: Explain why.

JaroslavTulach: New page: HiddenBuilder is a trick that hides the builder from Javadoc of your API. It may be very handy when the builder comes with a complex (generic type) signature like in case o... - 2016-06-20 06:41:28

New page: HiddenBuilder is a trick that hides the builder from Javadoc of your API. It may be very handy when the builder comes with a complex (generic type) signature like in case o...

New page

[[HiddenBuilder]] is a trick that hides the [[builder]] from [[Javadoc]] of your [[API]]. It may be very handy when the builder comes with a complex (generic type) signature like in case of [[ResistingBuilder]].

An example of [[HiddenBuilder]] can be found at [[Truffle]] [[API]]. There is {{truffle|com/oracle/truffle/api/vm|PolyglotEngine.Builder}} which constructs instances of {{truffle|com/oracle/truffle/api/vm|PolyglotEngine}}, but if you look at overall [[Truffle]] [[javadoc]], the [[builder]] isn't visible in the {{truffle|com/oracle/truffle/api/vm|package-overview}} list of classes.

[[TBD]]: Explain why.