String ifc = null, unless = null,
forEach = null, forEachBegin = null, forEachEnd = null;
AnnotationHelper attrAnnHelper = null;
for (Iterator it = el.getAttributeItems().iterator();
it.hasNext();) {
final Attribute attr = (Attribute)it.next();
final Namespace attrns = attr.getNamespace();
final String attURI = attrns != null ? attrns.getURI(): "";
final String attnm = attr.getLocalName();
final String attval = attr.getValue();
if (LanguageDefinition.ANNO_NAMESPACE.equals(attURI)
|| "annotation".equals(attURI)) {
if (bzk) warnWrongZkAttr(attr);
else {
if (attrAnnHelper == null)
attrAnnHelper = new AnnotationHelper();
attrAnnHelper.addByRawValue(attnm, attval);
}
} else if ("apply".equals(attnm) && isZkAttr(langdef, attrns)) {
if (bzk) warnWrongZkAttr(attr);
else compInfo.setApply(attval);
} else if ("forward".equals(attnm) && isZkAttr(langdef, attrns)) {
if (bzk) warnWrongZkAttr(attr);
else compInfo.setForward(attval);
} else if ("if".equals(attnm) && isZkAttr(langdef, attrns)) {
ifc = attval;
} else if ("unless".equals(attnm) && isZkAttr(langdef, attrns)) {
unless = attval;
} else if ("forEach".equals(attnm) && isZkAttr(langdef, attrns)) {
forEach = attval;
} else if ("forEachBegin".equals(attnm) && isZkAttr(langdef, attrns)) {
forEachBegin = attval;
} else if ("forEachEnd".equals(attnm) && isZkAttr(langdef, attrns)) {
forEachEnd = attval;
} else if ("fulfill".equals(attnm) && isZkAttr(langdef, attrns)) {
if (bzk) warnWrongZkAttr(attr);
else compInfo.setFulfill(attval);
} else if (bzk) {
if ("switch".equals(attnm) || "choose".equals(attnm)) {
if (isZkSwitch(parent))
throw new UiException("<zk "+attnm+"> cannot be used in <zk switch/choose>, "+el.getLocator());
((ZkInfo)compInfo).setSwitch(attval);
} else if ("case".equals(attnm)) {
if (!isZkSwitch(parent))
throw new UiException("<zk case> can be used only in <zk switch>, "+attr.getLocator());
((ZkInfo)compInfo).setCase(attval);
} else if ("when".equals(attnm)) {
ifc = attval;
} else {
final String attPref = attrns != null ? attrns.getPrefix(): null;
if (!"xmlns".equals(attnm) && !"xml".equals(attnm)
&& attURI.indexOf("w3.org") < 0
&& (attPref == null
|| (!"xmlns".equals(attPref) && !"xml".equals(attPref))))
warnWrongZkAttr(attr);
}
} else if (!("use".equals(attnm) && isZkAttr(langdef, attrns))) {
final String attPref = attrns != null ? attrns.getPrefix(): "";
if (!"xmlns".equals(attPref)
&& !("xmlns".equals(attnm) && "".equals(attPref))
&& !"http://www.w3.org/2001/XMLSchema-instance".equals(attURI)) {
if (isAttrAnnot(attval)) { //annotation
if (attrAnnHelper == null)
attrAnnHelper = new AnnotationHelper();
applyAttrAnnot(attrAnnHelper, compInfo, attnm, attval, true);
} else {
addAttribute(compInfo, attrns, attnm, attval, null,
attr.getLocator());
if (attrAnnHelper != null)
attrAnnHelper.applyAnnotations(compInfo, attnm, true);
}
}
}