contentfactory.java

来自「Some common function write by java」· Java 代码 · 共 53 行

JAVA
53
字号
/* * ContentFactory.java *  * Created on 2007-10-31, 17:47:23 *  * To change this template, choose Tools | Templates * and open the template in the editor. */package com.s7turn.sdk.content;/** * * @author Long */public abstract class ContentFactory {    //protected static Log logger = LogFactory.getLogger( ContentFactory.class );    public final static String CONTENT_FACTORY = "com.s7turn.contentProviderFactory";        public abstract ContentProvider createProvider();        public static ContentFactory createFactory() throws ContentException    {        try        {            ///select the contentFactory from system.properties;            String className = System.getProperties().getProperty( CONTENT_FACTORY );            Class cnf = Class.forName(className);            Object factory = cnf.newInstance();            if (factory instanceof ContentFactory)            {                return (ContentFactory) factory;            }                        throw new ContentException( "Can not find the ContentProviderFactory." );                    }        catch (InstantiationException ex)        {            throw new ContentException( ex.getMessage(), ex );        }        catch (IllegalAccessException ex)        {            throw new ContentException( ex.getMessage(), ex );        }        catch (ClassNotFoundException ex)        {            throw new ContentException( ex.getMessage(), ex );        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?