abstractms.java

来自「这个例子举例说明了一个简单的新闻 Portal。新闻内容是从数据源(这里称为 D」· Java 代码 · 共 56 行

JAVA
56
字号
package com.ddj.wsstruts.ms;

/**
 * Abstract Model service class contains all common methods
 * used in all Model services
 *
 * @author Jerome Josephraj
 * @version 1.00.00
 */

/**
 * Change History:
 * Author			Date			Version		Details
 * Jerome Josephraj		05 Nov 2002	        1.00.00		Initial Version
 */


//Java imports
import java.util.Vector;
import java.io.IOException;
import com.tbf.xml.XmlObject;

//Log4J imports
import org.apache.log4j.Category;
import org.apache.log4j.xml.DOMConfigurator;
import com.ddj.wsstruts.constant.SystemConstants;



public abstract class AbstractMs {
    //Log4J
    // define a static category variable so that it references the
    // category instance of the same name as this class.
    static final Category category = Category.getInstance(AbstractMs.class.getName());
    
    
    /*
     * Method to check for mandatory fields
     * It checks for both null and empty fields and returns a boolean
     *
     * @param stringField - String object
     * @exception              - throws any exception
     */
    public boolean checkForMandatory(String stringField)
    throws Exception {
        if(category.isDebugEnabled()) {
            category.debug(" String field = " + stringField);
        }
        
        if (stringField == null || stringField.equals("")) {
            return false;
        }
        return true;
    }
    
}

⌨️ 快捷键说明

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