controlfactory.java

来自「gcc3.2.1源代码」· Java 代码 · 共 76 行

JAVA
76
字号
/* Copyright (C) 2001  Free Software Foundation   This file is part of libgcj.This software is copyrighted work licensed under the terms of theLibgcj License.  Please consult the file "LIBGCJ_LICENSE" fordetails.  */ package javax.naming.ldap;import javax.naming.*;import java.util.StringTokenizer;import java.util.Hashtable;/** * @author Tom Tromey <tromey@redhat.com> * @date June 22, 2001 */public abstract class ControlFactory{  protected ControlFactory ()  {  }  public abstract Control getControlInstance (Control control)    throws NamingException;  public static Control getControlInstance (Control control,					    Context ctx,					    Hashtable env)    throws NamingException  {    String path = (String) env.get (LdapContext.CONTROL_FACTORIES);    String path2 = null;    if (ctx != null)      path2 = (String) ctx.getEnvironment ().get (LdapContext.CONTROL_FACTORIES);    if (path == null)      path = path2;    else if (path2 != null)      path += ":" + path2;    StringTokenizer tokens = new StringTokenizer (path, ":");    while (tokens.hasMoreTokens ())      {	String name = tokens.nextToken ();	try	  {	    Class k = Class.forName (name);	    ControlFactory cf = (ControlFactory) k.newInstance ();	    Control ctrl = cf.getControlInstance (control);	    if (ctrl != null)	      return ctrl;	  }	catch (ClassNotFoundException _1)	  {	    // Ignore it.	  }	catch (ClassCastException _2)	  {	    // Ignore it.	  }	catch (InstantiationException _3)	  {	    // If we couldn't instantiate the factory we might get	    // this.	  }	catch (IllegalAccessException _4)	  {	    // Another possibility when instantiating.	  }      }    return control;  }}

⌨️ 快捷键说明

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