RE: Trouble extending org.restlet.util.Template (private declarations)
Hi Matthias, Are you using Restlet version 1.0? If so, I suggest that you look at the 1.1 branch where we made the suggested changes! http://www.restlet.org/documentation/snapshot/api/org/restlet/util/Template. html Best regards, Jerome -Message d'origine- De : Matthias Wauer [mailto:[EMAIL PROTECTED] Envoyé : vendredi 2 mai 2008 15:47 À : discuss@restlet.tigris.org Objet : Trouble extending org.restlet.util.Template (private declarations) Just noticed an issue when subclassing Template. Scenario: For a template pattern /test/{type}/{id} with variables {type == testType} (no id defined in the map), i want format() to return /test/testType/{id} instead of the default /test/testType/null so i tried to subclass it. Issue: in Template, format(VariableResolver) and all the VariableResolver class definitions are all marked private, so i had to re-implement much of the Template format method. Solution: i suggest to mark those methods and classes _protected_ so they can be used by extending classes. Any comments? regards, Matthias
RE: Trouble extending org.restlet.util.Template (private declarations)
Hi Matthias, Are you using Restlet version 1.0? If so, I suggest that you look at the 1.1 branch where we made the suggested changes! http://www.restlet.org/documentation/snapshot/api/org/restlet/util/Template. html Best regards, Jerome Thanks for your response! Yes, I use v1.0. The v1.1 solution looks much better at first sight, no complains =) . Regards, Matthias -Message d'origine- De : Matthias Wauer [mailto:[EMAIL PROTECTED] Envoyé : vendredi 2 mai 2008 15:47 À : discuss@restlet.tigris.org Objet : Trouble extending org.restlet.util.Template (private declarations) Just noticed an issue when subclassing Template. Scenario: For a template pattern /test/{type}/{id} with variables {type == testType} (no id defined in the map), i want format() to return /test/testType/{id} instead of the default /test/testType/null so i tried to subclass it. Issue: in Template, format(VariableResolver) and all the VariableResolver class definitions are all marked private, so i had to re-implement much of the Template format method. Solution: i suggest to mark those methods and classes _protected_ so they can be used by extending classes. Any comments? regards, Matthias