<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Sat Dec 04 05:26:37 UTC 2010 --> <TITLE> AttributeSetterImpl </TITLE> <META NAME="date" CONTENT="2010-12-04"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="AttributeSetterImpl"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" 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_top_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> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AbstractXsSAXParser.html" title="class in org.apache.ws.jaxme.xs.parser.impl"><B>PREV CLASS</B></A> <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/ChildSetterImpl.html" title="class in org.apache.ws.jaxme.xs.parser.impl"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html" target="_top"><B>FRAMES</B></A> <A HREF="AttributeSetterImpl.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: NESTED | 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_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.ws.jaxme.xs.parser.impl</FONT> <BR> Class AttributeSetterImpl</H2> <PRE> java.lang.Object <IMG SRC="../../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.ws.jaxme.xs.parser.impl.AttributeSetterImpl</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/AttributeSetter.html" title="interface in org.apache.ws.jaxme.xs.parser">AttributeSetter</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>AttributeSetterImpl</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/AttributeSetter.html" title="interface in org.apache.ws.jaxme.xs.parser">AttributeSetter</A></DL> </PRE> <P> <p>Default implementation of the <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/AttributeSetter.html" title="interface in org.apache.ws.jaxme.xs.parser"><CODE>AttributeSetter</CODE></A> interface.</p> <P> <P> <DL> <DT><B>Author:</B></DT> <DD><a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a></DD> </DL> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#AttributeSetterImpl()">AttributeSetterImpl</A></B>()</CODE> <BR> </TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/XSContext.html" title="interface in org.apache.ws.jaxme.xs.parser">XSContext</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#getData()">getData</A></B>()</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#invokeMethod(java.lang.Object, java.lang.reflect.Method, java.lang.String, java.lang.Object[])">invokeMethod</A></B>(java.lang.Object pBean, java.lang.reflect.Method pMethod, java.lang.String pName, java.lang.Object[] pArgs)</CODE> <BR> This method invokes the beans <code>pBean</code> method <code>pMethod</code>, setting the attribute <code>pName</code> to the value <code>pArgs</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#setAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String)">setAttribute</A></B>(java.lang.String pQName, java.lang.String pNamespaceURI, java.lang.String pLocalName, java.lang.String pValue)</CODE> <BR> This method configures the bean <code>pBean</code> as follows: If the bean has a method <code>setAttribute(String, String, String)</code>, it is invoked with the following arguments: The attributes namespace URI (empty string for the default namespace), the attributes local name, and the property value Otherwise invokes its own method <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#setProperty(java.lang.Object, java.lang.String, java.lang.String, java.lang.String)"><CODE>setProperty(Object, String, String, String)</CODE></A>. </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#setProperty(java.lang.Object, java.lang.String, java.lang.String, java.lang.String)">setProperty</A></B>(java.lang.Object pBean, java.lang.String pQName, java.lang.String pName, java.lang.String pValue)</CODE> <BR> This method is invoked from within <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#setAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String)"><CODE>setAttribute(String, String, String, String)</CODE></A>.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="AttributeSetterImpl()"><!-- --></A><H3> AttributeSetterImpl</H3> <PRE> public <B>AttributeSetterImpl</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getData()"><!-- --></A><H3> getData</H3> <PRE> protected <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/XSContext.html" title="interface in org.apache.ws.jaxme.xs.parser">XSContext</A> <B>getData</B>()</PRE> <DL> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3> setAttribute</H3> <PRE> public void <B>setAttribute</B>(java.lang.String pQName, java.lang.String pNamespaceURI, java.lang.String pLocalName, java.lang.String pValue) throws org.xml.sax.SAXException</PRE> <DL> <DD><p>This method configures the bean <code>pBean</code> as follows: <ol> <li>If the bean has a method <code>setAttribute(String, String, String)</code>, it is invoked with the following arguments: <ul> <li>The attributes namespace URI (empty string for the default namespace),</li> <li>the attributes local name,</li> <li>and the property value</li> </ul> </li> <li>Otherwise invokes its own method <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#setProperty(java.lang.Object, java.lang.String, java.lang.String, java.lang.String)"><CODE>setProperty(Object, String, String, String)</CODE></A>.</li> </ol> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/AttributeSetter.html#setAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String)">setAttribute</A></CODE> in interface <CODE><A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/AttributeSetter.html" title="interface in org.apache.ws.jaxme.xs.parser">AttributeSetter</A></CODE></DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE>org.xml.sax.SAXException</CODE></DL> </DD> </DL> <HR> <A NAME="invokeMethod(java.lang.Object, java.lang.reflect.Method, java.lang.String, java.lang.Object[])"><!-- --></A><H3> invokeMethod</H3> <PRE> protected java.lang.Object <B>invokeMethod</B>(java.lang.Object pBean, java.lang.reflect.Method pMethod, java.lang.String pName, java.lang.Object[] pArgs) throws org.xml.sax.SAXException</PRE> <DL> <DD><p>This method invokes the beans <code>pBean</code> method <code>pMethod</code>, setting the attribute <code>pName</code> to the value <code>pArgs</code>.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE>org.xml.sax.SAXException</CODE></DL> </DD> </DL> <HR> <A NAME="setProperty(java.lang.Object, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3> setProperty</H3> <PRE> protected boolean <B>setProperty</B>(java.lang.Object pBean, java.lang.String pQName, java.lang.String pName, java.lang.String pValue) throws org.xml.sax.SAXException</PRE> <DL> <DD><p>This method is invoked from within <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html#setAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String)"><CODE>setAttribute(String, String, String, String)</CODE></A>. It configures the bean <code>pBean</code> as follows; <ol> <li>If the bean has a method <code>setProperty(String)</code> this method is invoked with the attribute value.</li> <li>If the bean has a method <code>setProperty(T)</code>, and the class <code>T</code> has either of a method <code>public static T valueOf(String)</code> or a constructor <code>public T(String)</code> (in that order), then the method <code>setProperty(T)</code> is invoked with the value obtained by an invocation of the method <code>valueOf()</code>, or the constructor, respectively. Note, that this applies in particular to the classes <CODE>Long</CODE>, <CODE>Integer</CODE>, <CODE>Short</CODE>, <CODE>Byte</CODE>, <CODE>Double</CODE>, <CODE>Float</CODE>, <code>java.math.BigInteger</code>, <code>java.math.BigDecimal</code>, <CODE>File</CODE>, and <CODE>StringBuffer</CODE>.</li> <li>If the bean has a method <code>setProperty(boolean)</code>, the method will be invoked with the value <i>true</i> (the value specified in the XML file is either of <code>true</code>, or <code>1</code>, otherwise with the value <code>false</code>.</li> <li>If the bean has a method <code>setProperty(char)</code>, or <code>setProperty(Character)</code>, the method will be invoked with the first character of the value specified in the XML file. If the value contains zero or multiple characters, an <CODE>IllegalArgumentException</CODE> is thrown.</li> <li>If the bean has either of the following methods, in that order: <ul> <li><code>setProperty(long)</code></li> <li><code>setProperty(int)</code></li> <li><code>setProperty(short)</code></li> <li><code>setProperty(byte)</code></li> <li><code>setProperty(double)</code></li> <li><code>setProperty(float)</code></li> </ul> then the property value is converted into the respective type and the method is invoked. An <CODE>IllegalArgumentException</CODE> is thrown, if the conversion fails.</li> <li>If the bean has a method <code>java.lang.Class</code>, the <code>XsSAXParser</code> will interpret the value given in the XML file as a Java class name and load the named class from its class loader. If the class cannot be loaded, it will also try to use the current threads context class loader. An exception is thrown, if neither of the class loaders can load the class.</li> </ol> </p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>True, if a method for setting the property was found. Otherwise false. <DT><B>Throws:</B> <DD><CODE>org.xml.sax.SAXException</CODE></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> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/AbstractXsSAXParser.html" title="class in org.apache.ws.jaxme.xs.parser.impl"><B>PREV CLASS</B></A> <A HREF="../../../../../../../org/apache/ws/jaxme/xs/parser/impl/ChildSetterImpl.html" title="class in org.apache.ws.jaxme.xs.parser.impl"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/apache/ws/jaxme/xs/parser/impl/AttributeSetterImpl.html" target="_top"><B>FRAMES</B></A> <A HREF="AttributeSetterImpl.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: NESTED | 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>