if (log.isLoggable(Level.FINE))
{
log.fine("Tag Pushed: " + orig);
}
Tag t = this.tagDecorator.decorate(orig);
String[] qname = this.determineQName(t);
t = this.trimAttributes(t);
if (isTrimmed(qname[0], qname[1]))
{
log.fine("Composition Found, Popping Parent Tags");
this.units.clear();
NamespaceUnit nsUnit = this.namespaceManager.toNamespaceUnit(this.tagLibrary);
this.units.push(nsUnit);
this.startUnit(new TrimmedTagUnit(this.tagLibrary, qname[0], qname[1], t, this.nextTagId()));
log.fine("New Namespace and [Trimmed] TagUnit pushed");
}
else if (isRemove(qname[0], qname[1]))
{
this.units.push(new RemoveUnit());
}
else if (isCompositeComponentInterface(qname[0], qname[1]))
{
// Here we have two cases when we found a <composite:interface> tag:
//
// - If a page has a <composite:interface> tag and a <composite:implementation> tag.
// In this case, we need to trim all tags outside this two tags, otherwise these
// unwanted tags will be added when the composite component is applied.
// Unfortunately, this is the only point we can do it, because after the compiler,
// html tags are wrapped on facelets UIInstruction or UIText components as "list",
// losing the original structure required to trim.
//
// - If a page has a <composite:interface> tag and not a <composite:implementation> tag.
// In this case, it is not necessary to trim, because we use the facelet only to create
// metadata and the component tree created is not used (see
// ViewDeclarationLanguage.getComponentMetadata() ). On InterfaceHandler, instead
// there is some code that found the right component in the temporal tree to add the
// generated BeanInfo, which it is retrieved later.
//
// After use Template Client API for composite components, it was found the need to
// gather metadata information from
log.fine("Composite Component Interface Found, saving unit");
CompositeComponentUnit compositeRootCompilationUnit = new CompositeComponentUnit();
this.startUnit(compositeRootCompilationUnit);
interfaceCompilationUnit = new TagUnit(this.tagLibrary, qname[0], qname[1], t, this.nextTagId());
this.startUnit(interfaceCompilationUnit);
}
else if (isCompositeComponentImplementation(qname[0], qname[1]))
{
log.fine("Composite component Found, Popping Parent Tags");
this.units.clear();
NamespaceUnit nsUnit = this.namespaceManager.toNamespaceUnit(this.tagLibrary);
this.units.push(nsUnit);
CompositeComponentUnit compositeRootCompilationUnit = new CompositeComponentUnit();
this.startUnit(compositeRootCompilationUnit);
if (interfaceCompilationUnit != null)
{
this.currentUnit().addChild(interfaceCompilationUnit);
interfaceCompilationUnit = null;
}
this.startUnit(new TrimmedTagUnit(this.tagLibrary, qname[0], qname[1], t, this.nextTagId()));
log.fine("New Namespace and TagUnit pushed");
}
else if (this.tagLibrary.containsTagHandler(qname[0], qname[1]))
{
this.startUnit(new TagUnit(this.tagLibrary, qname[0], qname[1], t, this.nextTagId()));
}
else if (this.tagLibrary.containsNamespace(qname[0]))
{
throw new TagException(orig, "Tag Library supports namespace: " + qname[0]
+ ", but no tag was defined for name: " + qname[1]);
}
else
{
TextUnit unit;
if (this.currentUnit() instanceof TextUnit)
{
unit = (TextUnit) this.currentUnit();
}
else
{
unit = new TextUnit(this.alias, this.nextTagId(), faceletsProcessingInstructions.isEscapeInlineText());
this.startUnit(unit);
}
if (this.compiler.isDevelopmentProjectStage())
{
String qName = null;
boolean isPrefixed = false;
TagAttribute jsfc = t.getAttributes().get("jsfc");
if (jsfc != null)
{
qName = jsfc.getValue();
if (jsfc.getValue().indexOf(':') > 0)
{
isPrefixed = true;
}
}
else if (t.getQName().indexOf(':') > 0 )
{
qName = t.getQName();
isPrefixed = true;
}
if (isPrefixed)
{
unit.addMessage(FacesMessage.SEVERITY_WARN,