Changeset 2958

Show
Ignore:
Timestamp:
03/08/07 17:05:48 (5 years ago)
Author:
michael
Message:

Improve API to make more consistent.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/java/org/sarugo/xtc/restlet/jpa/TemplateConverter.java

    r2953 r2958  
    3939        private Template listTemplate; 
    4040 
    41         public TemplateConverter(String template) throws TemplateException, 
     41        public TemplateConverter(String listTemplate) throws TemplateException, 
    4242                        ELException, IOException { 
    43                 this(template, MediaType.APPLICATION_XHTML_XML); 
     43                this(listTemplate, MediaType.APPLICATION_XHTML_XML); 
    4444        } 
    4545 
    46         public TemplateConverter(String template, MediaType mediaType) 
     46        public TemplateConverter(String listTemplate, MediaType mediaType) 
    4747                        throws TemplateException, ELException, IOException { 
    48                 this(null, template, mediaType); 
     48                this(listTemplate, null, mediaType); 
    4949        } 
    5050 
     
    109109        public void setListTemplate(String listTemplate) throws TemplateException, 
    110110                        ELException, IOException { 
    111                 this.listTemplate = TemplateFactory.getInstance().getTemplate( 
    112                                 listTemplate); 
     111                if (listTemplate == null) { 
     112                        this.listTemplate = null; 
     113                } else { 
     114                        this.listTemplate = TemplateFactory.getInstance().getTemplate( 
     115                                        listTemplate); 
     116                } 
    113117        } 
    114118 
     
    131135        public void setTemplate(String template) throws TemplateException, 
    132136                        ELException, IOException { 
    133                 this.template = TemplateFactory.getInstance().getTemplate(template); 
     137                if (template == null) { 
     138                        this.template = null; 
     139                } else { 
     140                        this.template = TemplateFactory.getInstance().getTemplate(template); 
     141                } 
    134142        } 
    135143