<html>
<head>


<title>Classe TagData</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Description">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">Classe TagData</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Nom de la classe&nbsp;:</td>
</tr>
<tr>
<td colspan="2" class="description">

<p><span class="LITERAL">javax.servlet.jsp.tagext.TagData</span></p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Etend&nbsp;:</td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Aucun</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Impl&eacute;mente&nbsp;:</td>
</tr>
<tr>
<td colspan="2" class="description">

<p><span class="LITERAL">Cloneable</span></p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Impl&eacute;ment&eacute;e par&nbsp;:</td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Classe interne d&eacute;pendante du container. La plupart des containers utilisent l'impl&eacute;mentation de r&eacute;f&eacute;rence de la classe (d&eacute;velopp&eacute;e dans le projet Apache Jakarta).
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Les instances <span class="LITERAL">TagData</span> sont cr&eacute;&eacute;es par le container web pendant la phase de traduction. Elles fournissent des informations sur les valeurs d'attribut sp&eacute;cifi&eacute;es d'une action personnalis&eacute;e de la sous-classe <span class="LITERAL">TagExtraInfo</span> pour le gestionnaire de balises correspondant, le cas &eacute;ch&eacute;ant.
</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Exemple</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>Lorsque le container web a termin&eacute; de v&eacute;rifier toutes les informations qu'il pouvait personnellement v&eacute;rifier en fonction des informations d'attribut contenus dans les TLD, il recherche une sous-classe <span class="LITERAL">TagExtraInfo</span>, d&eacute;finie par l'&eacute;l&eacute;ment <span class="LITERAL">&lt;teiclass&gt;</span> de l'action personnalis&eacute;e. Si une sous-classe est d&eacute;finie, il place toutes les informations d'attribut dans une instance de la classe <span class="LITERAL">TagData</span> et appelle la m&eacute;thode <span class="LITERAL">TagExtraInfo isValid()</span>&nbsp;:
</p>

<span class="PROGRAMLISTING"><pre>public boolean isValid(TagData data) {
    // Mutually exclusive attributes
    if (data.getAttribute(&quot;attr1&quot;) != null &amp;

        data.getAttribute(&quot;attr2&quot; != null) {
        return false;
    }

    // Dependent optional attributes
    if (data.getAttribute(&quot;attr3&quot;) != null &amp;

        data.getAttribute(&quot;attr4&quot; == null) {
        return false;
    }
    return true;
}</pre></span>

<p>Une sous-classe <span class="LITERAL">TagExtraInfo</span> peut faire appel &agrave; l'instance <span class="LITERAL">TagData</span> pour v&eacute;rifier que toutes les d&eacute;pendances d'attribut sont OK, comme dans l'exemple. Dans JSP 1.1, il n'existe malheureusement aucun moyen de g&eacute;n&eacute;rer un message d'erreur appropri&eacute;&nbsp;; la m&eacute;thode peut uniquement renvoyer la valeur <span class="LITERAL">false</span> pour signaler tout probl&egrave;me &eacute;ventuel. Ce probl&egrave;me sera fort heureusement corrig&eacute; dans une future version de JSP.
</p>
</td>
</tr>
</table>
</div>
<div id="TagDataObject">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">TagData()</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"> </td>
</tr>
<tr>
<td valign="top" colspan="2" class="usage"><span class="LITERAL">public TagData(Object[][] atts)</span></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description"><p>
Cr&eacute;e une nouvelle instance avec les paires valeur/nom d'attribut sp&eacute;cifi&eacute;es par l'&eacute;l&eacute;ment <span class="LITERAL">Object[][]</span>. L'&eacute;l&eacute;ment 0 de tous les <span class="LITERAL">Object[]</span> contient le nom&nbsp;; l'&eacute;l&eacute;ment 1 contient la valeur ou <span class="LITERAL">REQUEST_TIME_VALUE</span> (si la valeur de l'attribut est d&eacute;finie comme une valeur de demande de d&eacute;lai ou une expression JSP).
</p></td>
</tr>
</table>
</div>
<div id="TagDataHashtable">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">TagData()</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"> </td>
</tr>
<tr>
<td valign="top" colspan="2" class="usage"><span class="LITERAL">public TagData(java.util.Hashtable attrs)</span></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description"><p>
Cr&eacute;e une nouvelle instance avec les paires valeur/nom d'attribut sp&eacute;cifi&eacute;es par l'&eacute;l&eacute;ment <span class="LITERAL">Hashtable</span>.
</p></td>
</tr>
</table>
</div>
<div id="getAttribute">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">getAttribute()</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"> </td>
</tr>
<tr>
<td valign="top" colspan="2" class="usage"><span class="LITERAL">public Object getAttribute(String attName)</span></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description"><p>
Renvoie la valeur de l'attribut sp&eacute;cifi&eacute; sous forme de <span class="LITERAL">String</span> ou d'objet <span class="LITERAL">REQUEST_TIME_VALUE</span> (si la valeur de l'attribut est d&eacute;finie comme une valeur de demande de d&eacute;lai ou une expression JSP).
</p></td>
</tr>
</table>
</div>
<div id="getAttributeString">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">getAttributeString()</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"> </td>
</tr>
<tr>
<td valign="top" colspan="2" class="usage"><span class="LITERAL">public String getAttributeString(String attName)</span></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description"><p>
Renvoie la valeur d'attribut sp&eacute;cifi&eacute;e sous forme de <span class="LITERAL">String</span>. Une exception <span class="LITERAL">ClassCastException</span> est d&eacute;clench&eacute;e si la valeur de l'attribut est d&eacute;finie comme une valeur de demande de d&eacute;lai (une expression JSP).
</p></td>
</tr>
</table>
</div>
<div id="getId">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">getId()</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"> </td>
</tr>
<tr>
<td valign="top" colspan="2" class="usage"><span class="LITERAL">public String getId()</span></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description"><p>
Renvoie l'attribut nomm&eacute; <span class="LITERAL">id</span> sous forme de <span class="LITERAL">String</span> ou la valeur <span class="LITERAL">null</span> si l'attribut est introuvable.
</p></td>
</tr>
</table>
</div>
<div id="setAttribute">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">setAttribute()</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"> </td>
</tr>
<tr>
<td valign="top" colspan="2" class="usage"><span class="LITERAL">public void setAttribute(String attName, Object value)</span></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description"><p>
Affecte la valeur sp&eacute;cifi&eacute;e &agrave; l'attribut d&eacute;fini.
</p></td>
</tr>
</table>
</div>
</body>
</html>
