testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/templates/TemplateBuilderFactory.java
changeset 1 96906a986c3b
equal deleted inserted replaced
0:f1112f777ce9 1:96906a986c3b
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 package com.nokia.testfw.codegen.templates;
       
    19 
       
    20 public class TemplateBuilderFactory {
       
    21 
       
    22 	public static String TEMPLATEBUILDERCLASS = "com.nokia.testfw.codegen.templates.TemplateBuilder";
       
    23 	public static String DEFAULTTEMPLATEBUILDERCLASS = CMDTemplateBuilder.class
       
    24 			.getName();
       
    25 
       
    26 	public String iTemplateBuilderClassName;
       
    27 
       
    28 	public static TemplateBuilderFactory newInstance() {
       
    29 		String lClassName = System.getProperty(TEMPLATEBUILDERCLASS,
       
    30 				DEFAULTTEMPLATEBUILDERCLASS);
       
    31 		return new TemplateBuilderFactory(lClassName);
       
    32 	}
       
    33 
       
    34 	private TemplateBuilderFactory(String templateClassName) {
       
    35 		iTemplateBuilderClassName = templateClassName;
       
    36 	}
       
    37 
       
    38 	public TemplateBuilder newTemplateBuilder() throws InstantiationException,
       
    39 			IllegalAccessException, ClassNotFoundException {
       
    40 		return (TemplateBuilder) Class.forName(iTemplateBuilderClassName)
       
    41 				.newInstance();
       
    42 	}
       
    43 }