⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 domainutil.java

📁 j2ee tutorial
💻 JAVA
字号:
/* * * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. *  * This software is the proprietary information of Sun Microsystems, Inc.   * Use is subject to license terms. *  */package com.sun.ebank.util;import java.util.*;import com.sun.ebank.ejb.exception.*;/** * This helper class methods for getting and checking * the domains of business entity variables. */public final class DomainUtil {    // The accountTypes array stores the valid account types.    private static String[] accountTypes =        {"Checking" , "Savings" , "Credit" , "Money Market" };    public static String[] getAccountTypes()  {        return accountTypes;    }     public static void checkAccountType(String type)        throws IllegalAccountTypeException {        boolean foundIt = false;        for (int i = 0; i < accountTypes.length ; i++) {            if (accountTypes[i].equals(type))                foundIt = true;        }        if (foundIt == false)            throw new IllegalAccountTypeException(type);    }    public static boolean isCreditAccount(String type) {        if (type.equals("Credit"))            return true;        else            return false;    }} // DomainUtil

⌨️ 快捷键说明

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