complextype.html

来自「网络爬虫开源代码」· HTML 代码 · 共 1,346 行 · 第 1/5 页

HTML
1,346
字号
 If the key has not been overridden on the settings object for this ComplexType, then it traverses up until it find a DataContainer with the key for this ComplexType. This method should probably not be called from user code. It is a helper method for the settings framework.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - the settings object for which the <A HREF="../../../../org/archive/crawler/settings/DataContainer.html" title="class in org.archive.crawler.settings"><CODE>DataContainer</CODE></A>                 is active.<DD><CODE>key</CODE> - the key to look for.<DT><B>Returns:</B><DD>the active DataContainer.<DT><B>Throws:</B><DD><CODE>javax.management.AttributeNotFoundException</CODE></DL></DD></DL><HR><A NAME="getSettingsHandler()"><!-- --></A><H3>getSettingsHandler</H3><PRE>public <A HREF="../../../../org/archive/crawler/settings/SettingsHandler.html" title="class in org.archive.crawler.settings">SettingsHandler</A> <B>getSettingsHandler</B>()</PRE><DL><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getAbsoluteName()"><!-- --></A><H3>getAbsoluteName</H3><PRE>public java.lang.String <B>getAbsoluteName</B>()</PRE><DL><DD>Get the absolute name of this ComplexType. The absolute name is like a file path with the name of the element prepended by all the parents names separated by slashes.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>Absolute name.</DL></DD></DL><HR><A NAME="getSettingsFromObject(java.lang.Object, java.lang.String)"><!-- --></A><H3>getSettingsFromObject</H3><PRE><A HREF="../../../../org/archive/crawler/settings/ComplexType.Context.html" title="class in org.archive.crawler.settings">ComplexType.Context</A> <B>getSettingsFromObject</B>(java.lang.Object&nbsp;o,                                          java.lang.String&nbsp;attributeName)</PRE><DL><DD>Get settings object valid for a URI. <p/> This method takes an object, try to convert it into a <A HREF="../../../../org/archive/crawler/datamodel/CrawlURI.html" title="class in org.archive.crawler.datamodel"><CODE>CrawlURI</CODE></A> and then tries to get the settings object from it. If this fails, then the global settings object is returned. <p/> If the requested attribute is not set on this settings object it tries its parent until it gets a settings object where this attribute is set is found. If nothing is found, global settings is returned.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - possible <A HREF="../../../../org/archive/crawler/datamodel/CrawlURI.html" title="class in org.archive.crawler.datamodel"><CODE>CrawlURI</CODE></A>.<DD><CODE>attributeName</CODE> - the attribute that should have a value set on the            returned settings object.<DT><B>Returns:</B><DD>the settings object valid for the URI.</DL></DD></DL><HR><A NAME="getSettingsFromObject(java.lang.Object)"><!-- --></A><H3>getSettingsFromObject</H3><PRE><A HREF="../../../../org/archive/crawler/settings/ComplexType.Context.html" title="class in org.archive.crawler.settings">ComplexType.Context</A> <B>getSettingsFromObject</B>(java.lang.Object&nbsp;o)</PRE><DL><DD>Get settings object valid for a URI. This method takes an object, try to convert it into a <A HREF="../../../../org/archive/crawler/datamodel/CrawlURI.html" title="class in org.archive.crawler.datamodel"><CODE>CrawlURI</CODE></A> and then tries to get the settings object from it. If this fails, then the global settings object is returned.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - possible <A HREF="../../../../org/archive/crawler/datamodel/CrawlURI.html" title="class in org.archive.crawler.datamodel"><CODE>CrawlURI</CODE></A>.<DT><B>Returns:</B><DD>the settings object valid for the URI.</DL></DD></DL><HR><A NAME="isOverridden(org.archive.crawler.settings.CrawlerSettings, java.lang.String)"><!-- --></A><H3>isOverridden</H3><PRE>public boolean <B>isOverridden</B>(<A HREF="../../../../org/archive/crawler/settings/CrawlerSettings.html" title="class in org.archive.crawler.settings">CrawlerSettings</A>&nbsp;settings,                            java.lang.String&nbsp;name)                     throws javax.management.AttributeNotFoundException</PRE><DL><DD>Returns true if an element is overridden for this settings object.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>settings</CODE> - the settings object to investigate.<DD><CODE>name</CODE> - the name of the element to check.<DT><B>Returns:</B><DD>true if element is overridden for this settings object, false              if not set here or is first defined here.<DT><B>Throws:</B><DD><CODE>javax.management.AttributeNotFoundException</CODE> - if element doesn't exist.</DL></DD></DL><HR><A NAME="getAttribute(java.lang.String)"><!-- --></A><H3>getAttribute</H3><PRE>public java.lang.Object <B>getAttribute</B>(java.lang.String&nbsp;name)                              throws javax.management.AttributeNotFoundException,                                     javax.management.MBeanException,                                     javax.management.ReflectionException</PRE><DL><DD>Obtain the value of a specific attribute from the crawl order. If the attribute doesn't exist in the crawl order, the default value will be returned.<P><DD><DL><DT><B>Specified by:</B><DD><CODE>getAttribute</CODE> in interface <CODE>javax.management.DynamicMBean</CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute to be retrieved.<DT><B>Returns:</B><DD>The value of the attribute retrieved.<DT><B>Throws:</B><DD><CODE>javax.management.AttributeNotFoundException</CODE><DD><CODE>javax.management.MBeanException</CODE><DD><CODE>javax.management.ReflectionException</CODE></DL></DD></DL><HR><A NAME="getAttribute(java.lang.String, org.archive.crawler.datamodel.CrawlURI)"><!-- --></A><H3>getAttribute</H3><PRE>public java.lang.Object <B>getAttribute</B>(java.lang.String&nbsp;name,                                     <A HREF="../../../../org/archive/crawler/datamodel/CrawlURI.html" title="class in org.archive.crawler.datamodel">CrawlURI</A>&nbsp;uri)                              throws javax.management.AttributeNotFoundException</PRE><DL><DD>Obtain the value of a specific attribute that is valid for a specific CrawlURI. This method will try to get the attribute from the host settings valid for the CrawlURI. If it is not found it will traverse the settings up to the order and as a last resort deliver the default value. This is also the case if the CrawlURI is null or if the CrawlURI hasn't been assigned a CrawlServer.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute to be retrieved.<DD><CODE>uri</CODE> - the CrawlURI that this attribute should be valid for.<DT><B>Returns:</B><DD>The value of the attribute retrieved.<DT><B>Throws:</B><DD><CODE>javax.management.AttributeNotFoundException</CODE><DT><B>See Also:</B><DD><A HREF="../../../../org/archive/crawler/settings/ComplexType.html#getAttribute(java.lang.Object, java.lang.String)"><CODE>getAttribute(Object settings, String name)</CODE></A></DL></DD></DL><HR><A NAME="getAttribute(java.lang.Object, java.lang.String)"><!-- --></A><H3>getAttribute</H3><PRE>public java.lang.Object <B>getAttribute</B>(java.lang.Object&nbsp;context,                                     java.lang.String&nbsp;name)                              throws javax.management.AttributeNotFoundException</PRE><DL><DD>Obtain the value of a specific attribute that is valid for a specific CrawlerSettings object.<p>  This method will first try to get a settings object from the supplied context, then try to look up the attribute from this settings object. If it is not found it will traverse the settings up to the order and as a last resort deliver the default value.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - the object to get the settings from.<DD><CODE>name</CODE> - the name of the attribute to be retrieved.<DT><B>Returns:</B><DD>The value of the attribute retrieved.<DT><B>Throws:</B><DD><CODE>javax.management.AttributeNotFoundException</CODE><DT><B>See Also:</B><DD><A HREF="../../../../org/archive/crawler/settings/CrawlerSettings.html" title="class in org.archive.crawler.settings"><CODE>CrawlerSettings</CODE></A></DL></DD></DL><HR><A NAME="getUncheckedAttribute(java.lang.Object, java.lang.String)"><!-- --></A><H3>getUncheckedAttribute</H3><PRE>public java.lang.Object <B>getUncheckedAttribute</B>(java.lang.Object&nbsp;context,                                              java.lang.String&nbsp;name)</PRE><DL><DD>Obtain the value of a specific attribute that is valid for a specific CrawlerSettings object. <p>  This method will first try to get a settings object from the supplied context, then try to look up the attribute from this settings object. If it is not found it will traverse the settings up to the order and as a last resort deliver the default value. <p>  The only difference from the <A HREF="../../../../org/archive/crawler/settings/ComplexType.html#getAttribute(java.lang.Object, java.lang.String)"><CODE>getAttribute(Object, String)</CODE></A>is that this method doesn't throw any checked exceptions. If an undefined attribute is requested from a ComplexType, it is concidered a bug and a runtime exception is thrown instead.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - the object to get the settings from.<DD><CODE>name</CODE> - the name of the attribute to be retrieved.<DT><B>Returns:</B><DD>The value of the attribute retrieved.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE><DT><B>See Also:</B><DD><A HREF="../../../../org/archive/crawler/settings/ComplexType.html#getAttribute(java.lang.Object, java.lang.String)"><CODE>getAttribute(Object, String)</CODE></A>, <A HREF="../../../../org/archive/crawler/settings/CrawlerSettings.html" title="class in org.archive.crawler.settings"><CODE>CrawlerSettings</CODE></A></DL></DD></DL><HR><A NAME="getLocalAttribute(org.archive.crawler.settings.CrawlerSettings, java.lang.String)"><!-- --></A><H3>getLocalAttribute</H3><PRE>public java.lang.Object <B>getLocalAttribute</B>(<A HREF="../../../../org/archive/crawler/settings/CrawlerSettings.html" title="class in org.archive.crawler.settings">CrawlerSettings</A>&nbsp;settings,                                          java.lang.String&nbsp;name)                                   throws javax.management.AttributeNotFoundException</PRE><DL><DD>Obtain the value of a specific attribute that is valid for a specific CrawlerSettings object. This method will try to get the attribute from the supplied host settings object. If it is not found it will return <code>null</code> and not try to investigate the hierarchy of settings.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>settings</CODE> - the CrawlerSettings object to search for this attribute.<DD><CODE>name</CODE> - the name of the attribute to be retrieved.<DT><B>Returns:</B><DD>The value of the attribute retrieved or null if its not set.<DT><B>Throws:</B><DD><CODE>javax.management.AttributeNotFoundException</CODE> - is thrown if the attribute doesn't         exist.<DT><B>See Also:</B><DD><A HREF="../../../../org/archive/crawler/settings/CrawlerSettings.html" title="class in org.archive.crawler.settings"><CODE>CrawlerSettings</CODE></A></DL></DD></DL><HR><A NAME="setAttribute(javax.management.Attribute)"><!-- --></A><H3>

⌨️ 快捷键说明

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