objectfactory.html
来自「基于mondrian 开源框架进行OLAP多维分析」· HTML 代码 · 共 888 行 · 第 1/3 页
HTML
888 行
to look up a class name. The constructor for the object takes no parameters.<P><DD><DL><DT><B>Returns:</B><DD>the newly created object<DT><B>Throws:</B><DD><CODE><A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></CODE> - if unable to create the object</DL></DD></DL><HR><A NAME="getObject(java.util.Properties)"><!-- --></A><H3>getObject</H3><PRE>protected final <A HREF="../../mondrian/util/ObjectFactory.html" title="type parameter in ObjectFactory">V</A> <B>getObject</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html" title="class or interface in java.util">Properties</A> props) throws <A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></PRE><DL><DD>Constructs an object where the <code>Properties</code> parameter can be used to look up a class name. The constructor for the object takes no parameters.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>props</CODE> - the property definitions to use to determine the implementation class<DT><B>Returns:</B><DD>the newly created object<DT><B>Throws:</B><DD><CODE><A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></CODE> - if unable to create the object</DL></DD></DL><HR><A NAME="getObject(java.lang.Class[], java.lang.Object[])"><!-- --></A><H3>getObject</H3><PRE>protected final <A HREF="../../mondrian/util/ObjectFactory.html" title="type parameter in ObjectFactory">V</A> <B>getObject</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A>[] parameterTypes, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] parameterValues) throws <A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></PRE><DL><DD>Constructs an object where the <code>parameterTypes</code> and <code>parameterValues</code> are constructor parameters and System Properties are used to look up a class name.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterTypes</CODE> - the class parameters that define the signature of the constructor to use<DD><CODE>parameterValues</CODE> - the values to use to construct the current instance of the object<DT><B>Returns:</B><DD>the newly created object<DT><B>Throws:</B><DD><CODE><A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></CODE> - if unable to create the object</DL></DD></DL><HR><A NAME="getObject(java.util.Properties, java.lang.Class[], java.lang.Object[])"><!-- --></A><H3>getObject</H3><PRE>protected <A HREF="../../mondrian/util/ObjectFactory.html" title="type parameter in ObjectFactory">V</A> <B>getObject</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html" title="class or interface in java.util">Properties</A> props, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A>[] parameterTypes, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] parameterValues) throws <A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></PRE><DL><DD>Constructs an object where the <code>parameterTypes</code> and <code>parameterValues</code> are constructor parameters and Properties parameter is used to look up a class name. <p> This returns a new instance of the Object each time its called (assuming that if the method <code>getDefault</code>, which derived classes implement), if called, creates a new object each time.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>props</CODE> - the property definitions to use to determine the<DD><CODE>parameterTypes</CODE> - the class parameters that define the signature of the constructor to use<DD><CODE>parameterValues</CODE> - the values to use to construct the current instance of the object<DT><B>Returns:</B><DD>the newly created object<DT><B>Throws:</B><DD><CODE><A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></CODE> - if unable to create the object</DL></DD></DL><HR><A NAME="getObject(java.lang.String, java.lang.Class[], java.lang.Object[])"><!-- --></A><H3>getObject</H3><PRE>protected <A HREF="../../mondrian/util/ObjectFactory.html" title="type parameter in ObjectFactory">V</A> <B>getObject</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> className, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A>[] parameterTypes, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] parameterValues) throws <A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></PRE><DL><DD>Creates an instance with the given <code>className</code>, <code>parameterTypes</code> and <code>parameterValues</code> or throw a <code>CreationException</code>. There are two different mechanims available. The first is to uses reflection to create the instance typing the generated Object based upon the <code>interfaceClass</code> factory instance object. With the second the <code>className</code> is an class that implements the <code>InvocationHandler</code> interface and in this case the <code>java.lang.reflect.Proxy</code> class is used to generate a proxy.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>className</CODE> - the class name used to create Object instance<DD><CODE>parameterTypes</CODE> - the class parameters that define the signature of the constructor to use<DD><CODE>parameterValues</CODE> - the values to use to construct the current instance of the object<DT><B>Returns:</B><DD>the newly created object<DT><B>Throws:</B><DD><CODE><A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></CODE> - if unable to create the object</DL></DD></DL><HR><A NAME="getClassName()"><!-- --></A><H3>getClassName</H3><PRE>protected <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getClassName</B>()</PRE><DL><DD>Returns the name of a class to use to create an object. The default implementation returns null but derived classes can return a class name. <p> This method is the primary mechanism for supporting Unit testing. A derived class can have, as an example, this method return the value of a <code>ThreadLocal</code>. For testing it return a class name while for normal use it returns <code>null</code>.<P><DD><DL><DT><B>Returns:</B><DD><code>null</code> or a class name</DL></DD></DL><HR><A NAME="getClassName(java.util.Properties)"><!-- --></A><H3>getClassName</H3><PRE>protected <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getClassName</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html" title="class or interface in java.util">Properties</A> props)</PRE><DL><DD>Returns the name of a class to use to create an object. The factory's <code>StringProperty</code> is gotten and if it has a non-null value, then that is returned. Otherwise, the <code>StringProperty</code>'s name (path) is used as the name to probe the <code>Properties</code> object for a value. This method is allowed to return null.<P><DD><DL><DT><B>Returns:</B><DD><code>null</code> or a class name</DL></DD></DL><HR><A NAME="getStringProperty()"><!-- --></A><H3>getStringProperty</H3><PRE>protected abstract <A HREF="http://farrago.sourceforge.net/api/org/eigenbase/util/property/StringProperty.html" title="class or interface in org.eigenbase.util.property">StringProperty</A> <B>getStringProperty</B>()</PRE><DL><DD>Return the <code>StringProperty</code> associated with this factory.<P><DD><DL><DT><B>Returns:</B><DD>the <code>StringProperty</code></DL></DD></DL><HR><A NAME="getDefault(java.lang.Class[], java.lang.Object[])"><!-- --></A><H3>getDefault</H3><PRE>protected abstract <A HREF="../../mondrian/util/ObjectFactory.html" title="type parameter in ObjectFactory">V</A> <B>getDefault</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A>[] parameterTypes, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] parameterValues) throws <A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></PRE><DL><DD>For most uses (other than testing) this is the method that derived classes implement that return the desired object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>parameterTypes</CODE> - the class parameters that define the signature of the constructor to use<DD><CODE>parameterValues</CODE> - the values to use to construct the current instance of the object<DT><B>Returns:</B><DD>the newly created object<DT><B>Throws:</B><DD><CODE><A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A></CODE> - if unable to create the object</DL></DD></DL><HR><A NAME="defaultCreationException()"><!-- --></A><H3>defaultCreationException</H3><PRE>protected <A HREF="../../mondrian/util/CreationException.html" title="class in mondrian.util">CreationException</A> <B>defaultCreationException</B>()</PRE><DL><DD>Factory method which creates an exception to be thrown if an object can not be created.<P><DD><DL><DT><B>Returns:</B><DD>an exception to be thrown if an object can not be created</DL></DD></DL><HR><A NAME="removeContext()"><!-- --></A><H3>removeContext</H3><PRE>public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>removeContext</B>()</PRE><DL><DD>Get the current override values in the opaque context object and clear those values within the Factory. <p> This is used in testing.<P><DD><DL><DT><B>Returns:</B><DD>the test <code>Context</code> object.</DL></DD></DL><HR><A NAME="restoreContext(java.lang.Object)"><!-- --></A><H3>restoreContext</H3><PRE>public void <B>restoreContext</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> context)</PRE><DL><DD>Restore the context object resetting override values. <p> This is used in testing.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - the context object to be restored.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><a href="http://sourceforge.net/projects/mondrian"><img src="http://sourceforge.net/sflogo.php?group_id=35302&type=1" width="88" height="31" border="0" alt="SourceForge.net_Logo"></a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../mondrian/util/NotificationMemoryMonitor.html" title="class in mondrian.util"><B>PREV CLASS</B></A> <A HREF="../../mondrian/util/ObjectFactory.Context.html" title="interface in mondrian.util"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?mondrian/util/ObjectFactory.html" target="_top"><B>FRAMES</B></A> <A HREF="ObjectFactory.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?