You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/10/07 10:39:20 UTC
svn commit: r453861 - in /myfaces/tobago/trunk:
core/src/main/java/org/apache/myfaces/tobago/convert/
core/src/main/java/org/apache/myfaces/tobago/taglib/component/
core/src/main/java/org/apache/myfaces/tobago/taglib/decl/
tobago-tool/tobago-tool-annot...
Author: bommel
Date: Sat Oct 7 01:39:18 2006
New Revision: 453861
URL: http://svn.apache.org/viewvc?view=rev&rev=453861
Log:
[TOBAGO-140] generate faces-config from annotations
Added:
myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Converter.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Validator.java
Modified:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/CurrencyConverter.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/LocaleConverter.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/ThemeConverter.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTag.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ImageTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuBarTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessageTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ObjectTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ProgressTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectReferenceTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTagDeclaration.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasActionListener.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasSuggestMethod.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasValueChangeListener.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationProcessorFactory.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/CurrencyConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/CurrencyConverter.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/CurrencyConverter.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/CurrencyConverter.java Sat Oct 7 01:39:18 2006
@@ -27,6 +27,7 @@
import javax.faces.convert.ConverterException;
import java.util.Currency;
+@org.apache.myfaces.tobago.apt.annotation.Converter(forClass = "java.util.Currency")
public class CurrencyConverter implements Converter {
public Object getAsObject(FacesContext facesContext, UIComponent component,
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/DurationConverter.java Sat Oct 7 01:39:18 2006
@@ -30,6 +30,7 @@
import java.util.List;
import java.util.StringTokenizer;
+@org.apache.myfaces.tobago.apt.annotation.Converter(id=DurationConverter.CONVERTER_ID)
public class DurationConverter implements Converter {
private static final Log LOG = LogFactory.getLog(DurationConverter.class);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/LocaleConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/LocaleConverter.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/LocaleConverter.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/LocaleConverter.java Sat Oct 7 01:39:18 2006
@@ -23,7 +23,7 @@
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import java.util.Locale;
-
+@org.apache.myfaces.tobago.apt.annotation.Converter(forClass = "java.util.Locale")
public class LocaleConverter implements Converter {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/ThemeConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/ThemeConverter.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/ThemeConverter.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/convert/ThemeConverter.java Sat Oct 7 01:39:18 2006
@@ -26,6 +26,7 @@
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
+@org.apache.myfaces.tobago.apt.annotation.Converter(forClass = "org.apache.myfaces.tobago.context.Theme")
public class ThemeConverter implements Converter {
private static final Log LOG = LogFactory.getLog(ThemeConverter.class);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CalendarTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -34,7 +34,7 @@
@Tag(name = "calendar", bodyContent = BodyContent.EMPTY)
@UIComponentTag(
uiComponent = "javax.faces.component.UIOutput",
- rendererType = "Calendar")
+ rendererType = "Calendar" , isComponentAlreadyDefined = true)
public interface CalendarTagDeclaration extends TobagoTagDeclaration, HasIdBindingAndRendered {
/**
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTag.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTag.java Sat Oct 7 01:39:18 2006
@@ -22,7 +22,7 @@
import javax.faces.component.UIComponent;
-public class HiddenTag extends BeanTag implements HiddenTagDeclaration {
+public class HiddenTag extends InputTag implements HiddenTagDeclaration {
protected void setProperties(UIComponent component) {
super.setProperties(component);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/HiddenTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -22,6 +22,8 @@
import org.apache.myfaces.tobago.taglib.decl.HasBinding;
import org.apache.myfaces.tobago.taglib.decl.HasId;
import org.apache.myfaces.tobago.taglib.decl.HasValue;
+import org.apache.myfaces.tobago.taglib.decl.HasConverter;
+import org.apache.myfaces.tobago.taglib.decl.HasValidator;
/*
* Created: Aug 5, 2005 4:08:32 PM
@@ -35,7 +37,8 @@
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UIHiddenInput",
rendererType = "Hidden")
-public interface HiddenTagDeclaration extends BeanTagDeclaration, HasId, HasBinding, HasValue {
+public interface HiddenTagDeclaration extends BeanTagDeclaration, HasId, HasBinding, HasValue, HasConverter,
+ HasValidator {
@UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
void setInline(String inline);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ImageTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ImageTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ImageTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ImageTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -37,7 +37,7 @@
@Tag(name = "image", bodyContent = BodyContent.EMPTY)
@UIComponentTag(
uiComponent = "javax.faces.component.UIGraphic",
- rendererType = "Image")
+ rendererType = "Image", isComponentAlreadyDefined = true)
public interface ImageTagDeclaration extends TobagoTagDeclaration,
HasIdBindingAndRendered, HasBorder, HasDimension, HasTip {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuBarTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuBarTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuBarTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuBarTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -42,6 +42,6 @@
"org.apache.myfaces.tobago.taglib.component.MenuSeparatorTag" })
@UIComponentTag(
uiComponent = "javax.faces.component.UIPanel",
- rendererType = "MenuBar")
+ rendererType = "MenuBar", isComponentAlreadyDefined = true)
public interface MenuBarTagDeclaration extends TobagoBodyTagDeclaration, HasIdBindingAndRendered, HasDeprecatedWidth {
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessageTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessageTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessageTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessageTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -35,6 +35,6 @@
@Tag(name = "message", bodyContent = BodyContent.EMPTY)
@UIComponentTag(
uiComponent = "javax.faces.component.UIMessage",
- rendererType = "Message")
+ rendererType = "Message", isComponentAlreadyDefined = true)
public interface MessageTagDeclaration extends TobagoTagDeclaration, HasIdBindingAndRendered, HasFor {
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -37,7 +37,7 @@
@Tag(name = "messages", bodyContent = BodyContent.EMPTY)
@UIComponentTag(
uiComponent = "javax.faces.component.UIMessages",
- rendererType = "Messages")
+ rendererType = "Messages", isComponentAlreadyDefined = true)
public interface MessagesTagDeclaration extends TobagoTagDeclaration, HasIdBindingAndRendered, HasFor {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ObjectTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ObjectTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ObjectTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ObjectTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -31,7 +31,7 @@
@Tag(name = "object", bodyContent = BodyContent.EMPTY)
@UIComponentTag(
uiComponent = "javax.faces.component.UIOutput",
- rendererType = "Object")
+ rendererType = "Object", isComponentAlreadyDefined = true)
public interface ObjectTagDeclaration extends TobagoTagDeclaration {
/**
* URI to object source
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ProgressTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ProgressTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ProgressTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ProgressTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -35,7 +35,7 @@
@Tag(name = "progress", bodyContent = BodyContent.EMPTY)
@UIComponentTag(
uiComponent = "javax.faces.component.UIOutput",
- rendererType = "Progress")
+ rendererType = "Progress", isComponentAlreadyDefined = true)
public interface ProgressTagDeclaration extends BeanTagDeclaration, HasIdBindingAndRendered, HasTip {
/**
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -41,7 +41,7 @@
@BodyContentDescription(anyTagOf = "<f:facet>* ")
@UIComponentTag(
uiComponent = "javax.faces.component.UISelectBoolean",
- rendererType = "SelectBooleanCheckbox")
+ rendererType = "SelectBooleanCheckbox", isComponentAlreadyDefined = true)
public interface SelectBooleanCheckboxTagDeclaration extends BeanTagDeclaration, HasValidator,
HasOnchange, HasValueChangeListener, HasIdBindingAndRendered, HasLabelAndAccessKey, HasBooleanValue, IsDisabled,
IsInline, HasTip {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -26,6 +26,7 @@
import org.apache.myfaces.tobago.taglib.decl.IsInline;
import org.apache.myfaces.tobago.taglib.decl.IsRendered;
import org.apache.myfaces.tobago.taglib.decl.HasConverter;
+import org.apache.myfaces.tobago.taglib.decl.IsReadonly;
/*
* Created: Aug 5, 2005 5:54:37 PM
@@ -40,9 +41,10 @@
@BodyContentDescription(anyTagOf= "(<f:selectItems>|<f:selectItem>|<tc:selectItem>)+ <f:facet>* ")
@UIComponentTag(
uiComponent = "javax.faces.component.UISelectMany",
- rendererType = "SelectManyCheckbox")
+ rendererType = "SelectManyCheckbox", isComponentAlreadyDefined = true)
public interface SelectManyCheckboxTagDeclaration extends
SelectManyTagDeclaration, IsDisabled, HasId,
- IsInline, HasRenderRange, IsRendered, HasBinding, HasConverter {
+ IsInline, HasRenderRange, IsRendered, HasBinding, //IsReadonly,
+ HasConverter {
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -26,6 +26,7 @@
import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
import org.apache.myfaces.tobago.taglib.decl.IsInline;
import org.apache.myfaces.tobago.taglib.decl.IsRendered;
+import org.apache.myfaces.tobago.taglib.decl.IsReadonly;
/*
* Created: Aug 5, 2005 5:58:55 PM
@@ -42,6 +43,6 @@
public interface SelectManyListboxTagDeclaration
extends SelectManyTagDeclaration, HasId, IsDisabled,
- HasDeprecatedHeight, IsInline, HasLabelAndAccessKey, IsRendered, HasBinding, HasTip {
+ HasDeprecatedHeight, IsInline, HasLabelAndAccessKey, IsRendered, HasBinding, HasTip, IsReadonly {
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -21,6 +21,7 @@
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.Facet;
import org.apache.myfaces.tobago.taglib.decl.HasBinding;
import org.apache.myfaces.tobago.taglib.decl.HasId;
import org.apache.myfaces.tobago.taglib.decl.HasLabelAndAccessKey;
@@ -44,7 +45,15 @@
@BodyContentDescription(anyTagOf = "(<f:selectItems>|<f:selectItem>|<tc:selectItem>)+ <f:facet>* ")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UISelectOne",
- rendererType = "SelectOneChoice")
+ rendererType = "SelectOneChoice",
+ facets = {
+ @Facet(name = "click",
+ description =
+ "This facet can contain a UICommandthat is invoked in a case of a click events from the component" ),
+ @Facet(name = "change",
+ description =
+ "This facet can contain a UICommand that is invoked in a case of a change events from the component" )
+ } )
public interface SelectOneChoiceTagDeclaration
extends SelectOneTagDeclaration, HasId, IsDisabled,
IsReadonly, IsInline, HasLabelAndAccessKey,
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -21,6 +21,7 @@
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.Facet;
import org.apache.myfaces.tobago.taglib.decl.HasBinding;
import org.apache.myfaces.tobago.taglib.decl.HasDeprecatedHeight;
import org.apache.myfaces.tobago.taglib.decl.HasId;
@@ -42,7 +43,15 @@
@BodyContentDescription(anyTagOf = "(<f:selectItems>|<f:selectItem>|<tc:selectItem>)+ <f:facet>* ")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UISelectOne",
- rendererType = "SelectOneListbox")
+ rendererType = "SelectOneListbox",
+ facets = {
+ @Facet(name = "click",
+ description =
+ "This facet can contain a UICommandthat is invoked in a case of a click events from the component" ),
+ @Facet(name = "change",
+ description =
+ "This facet can contain a UICommand that is invoked in a case of a change events from the component" )
+ })
public interface SelectOneListboxTagDeclaration extends SelectOneTagDeclaration, HasId, IsDisabled,
IsReadonly, HasLabelAndAccessKey, IsRendered, HasBinding, HasDeprecatedHeight, HasTip {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -21,6 +21,7 @@
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.Facet;
import org.apache.myfaces.tobago.taglib.decl.HasBinding;
import org.apache.myfaces.tobago.taglib.decl.HasId;
import org.apache.myfaces.tobago.taglib.decl.HasRenderRange;
@@ -41,7 +42,15 @@
@BodyContentDescription(anyTagOf = "(<f:selectItems>|<f:selectItem>|<tc:selectItem>)+ <f:facet>* ")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UISelectOne",
- rendererType = "SelectOneRadio")
+ rendererType = "SelectOneRadio",
+facets = {
+ @Facet(name = "click",
+ description =
+ "This facet can contain a UICommandthat is invoked in a case of a click events from the component" ),
+ @Facet(name = "change",
+ description =
+ "This facet can contain a UICommand that is invoked in a case of a change events from the component" )
+ })
public interface SelectOneRadioTagDeclaration extends SelectOneTagDeclaration, IsDisabled, HasId,
IsInline, HasRenderRange, IsRendered, HasBinding, HasConverter {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectReferenceTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectReferenceTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectReferenceTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectReferenceTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -37,7 +37,7 @@
@Tag(name = "selectReference", bodyContent = BodyContent.EMPTY)
@UIComponentTag(
uiComponent = "javax.faces.component.UIOutput",
- rendererType = "SelectReference")
+ rendererType = "SelectReference", isComponentAlreadyDefined = true)
public interface SelectReferenceTagDeclaration extends TobagoTagDeclaration, HasIdBindingAndRendered {
/**
* Id of the component, this is related to.
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTagDeclaration.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTagDeclaration.java Sat Oct 7 01:39:18 2006
@@ -36,7 +36,7 @@
*/
@Tag(name = "time")
@UIComponentTag(
- uiComponent = "org.apache.myfaces.tobago.component.UIInput",
+ uiComponent = "org.apache.myfaces.tobago.component.UITimeInput",
rendererType =RENDERER_TYPE_TIME)
public interface TimeTagDeclaration
extends InputTagDeclaration, HasIdBindingAndRendered,
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java Sat Oct 7 01:39:18 2006
@@ -18,6 +18,7 @@
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
/**
* $Id$
@@ -34,7 +35,8 @@
* The String is directly passed to the Navigationhandler.
*
*/
- @TagAttribute @UIComponentTagAttribute()
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.el.MethodBinding", expression = DynamicExpression.METHOD_BINDING)
void setAction(String action);
-
+
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasActionListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasActionListener.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasActionListener.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasActionListener.java Sat Oct 7 01:39:18 2006
@@ -32,6 +32,7 @@
* parameter, with a return type of void.
*
*/
- @TagAttribute @UIComponentTagAttribute(expression = DynamicExpression.METHOD_BINDING)
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.el.MethodBinding", expression = DynamicExpression.METHOD_BINDING)
void setActionListener(String actionListener);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasSuggestMethod.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasSuggestMethod.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasSuggestMethod.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasSuggestMethod.java Sat Oct 7 01:39:18 2006
@@ -31,7 +31,7 @@
* @param suggestMethod
*/
@TagAttribute
- @UIComponentTagAttribute(expression = DynamicExpression.METHOD_BINDING)
+ @UIComponentTagAttribute(type = "javax.faces.el.MethodBinding", expression = DynamicExpression.METHOD_BINDING)
void setSuggestMethod(String suggestMethod);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasValueChangeListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasValueChangeListener.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasValueChangeListener.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasValueChangeListener.java Sat Oct 7 01:39:18 2006
@@ -35,6 +35,6 @@
* @param valueChangeListener
*/
@TagAttribute
- @UIComponentTagAttribute(expression = DynamicExpression.METHOD_BINDING)
+ @UIComponentTagAttribute(type = "javax.faces.el.MethodBinding", expression = DynamicExpression.METHOD_BINDING)
void setValueChangeListener(String valueChangeListener);
}
Added: myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Converter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Converter.java?view=auto&rev=453861
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Converter.java (added)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Converter.java Sat Oct 7 01:39:18 2006
@@ -0,0 +1,29 @@
+package org.apache.myfaces.tobago.apt.annotation;
+
+/*
+ * Copyright 2002-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: Oct 4, 2006
+ * Time: 7:59:19 PM
+ */
+
+public @interface Converter {
+ String id() default "";
+ String forClass() default "";
+}
Added: myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Validator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Validator.java?view=auto&rev=453861
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Validator.java (added)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Validator.java Sat Oct 7 01:39:18 2006
@@ -0,0 +1,28 @@
+package org.apache.myfaces.tobago.apt.annotation;
+
+/*
+ * Copyright 2002-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: Oct 6, 2006
+ * Time: 9:35:39 PM
+ */
+public @interface Validator {
+ String id() default "";
+ String forClass() default "";
+}
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationProcessorFactory.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationProcessorFactory.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationProcessorFactory.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationProcessorFactory.java Sat Oct 7 01:39:18 2006
@@ -37,7 +37,9 @@
private static final Collection<String> SUPPORTED_ANNOTATIONS
= Collections.unmodifiableCollection(Arrays.asList("org.apache.myfaces.tobago.apt.annotation.Tag",
"org.apache.myfaces.tobago.apt.annotation.TagAttribute", "org.apache.myfaces.tobago.apt.annotation.Taglib",
- "org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute"));
+ "org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute",
+ "org.apache.myfaces.tobago.apt.annotation.Converter",
+ "org.apache.myfaces.tobago.apt.annotation.Validator"));
private static final Collection<String> SUPPORTED_OPTIONS =
Collections.unmodifiableCollection(Arrays.asList(FacesConfigAnnotationVisitor.SOURCE_FACES_CONFIG_KEY,
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java?view=diff&rev=453861&r1=453860&r2=453861
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java Sat Oct 7 01:39:18 2006
@@ -27,6 +27,8 @@
import org.apache.myfaces.tobago.apt.annotation.Facet;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.Converter;
+import org.apache.myfaces.tobago.apt.annotation.Validator;
import org.apache.commons.io.IOUtils;
import org.codehaus.plexus.util.FileUtils;
import org.jdom.Comment;
@@ -62,7 +64,7 @@
public static String SOURCE_FACES_CONFIG_KEY = "sourceFacesConfig";
public static String TARGET_FACES_CONFIG_KEY = "targetFacesConfig";
- private static final String SEPERATOR = System.getProperty( "line.separator" );
+ private static final String SEPARATOR = System.getProperty( "line.separator" );
private static final String COMPONENT = "component";
private static final String COMPONENT_TYPE = "component-type";
private static final String COMPONENT_CLASS = "component-class";
@@ -77,6 +79,14 @@
private static final String ATTRIBUTE_CLASS = "attribute-class";
private static final String APPLICATION = "application";
private static final String FACTORY = "factory";
+ private static final String CONVERTER = "converter";
+ private static final String CONVERTER_ID = "converter-id";
+ private static final String CONVERTER_FOR_CLASS = "converter-for-class";
+ private static final String CONVERTER_CLASS = "converter-class";
+ private static final String VALIDATOR = "validator";
+ private static final String VALIDATOR_ID = "validator-id";
+ private static final String VALIDATOR_FOR_CLASS = "validator-for-class";
+ private static final String VALIDATOR_CLASS = "validator-class";
public FacesConfigAnnotationVisitor(AnnotationProcessorEnvironment env) {
super(env);
@@ -122,10 +132,17 @@
List<Element> components = rootElement.getChildren(COMPONENT, namespace);
List<Element> newComponents = new ArrayList<Element>();
+ List<Element> newConverters = new ArrayList<Element>();
+ List<Element> newValidators = new ArrayList<Element>();
for (ClassDeclaration decl : getCollectedClassDeclations()) {
- if (decl.getPackage().equals(packageDeclaration)) {
+ if (decl.getPackage().equals(packageDeclaration)
+ && decl.getAnnotation(UIComponentTag.class) != null) {
addElement(decl, newComponents, namespace);
+ } else if (decl.getAnnotation(Converter.class) != null) {
+ addConverter(decl, newConverters, namespace);
+ } else if (decl.getAnnotation(Validator.class) != null) {
+ addValidator(decl, newValidators, namespace);
}
}
@@ -135,25 +152,26 @@
}
}
List<Element> elementsToAdd = new ArrayList<Element>();
-
+ // sort out duplicates
for (Element newElement: newComponents) {
boolean found = containsElement(components, newElement);
if (!found) {
+
elementsToAdd.add(newElement);
}
}
- if (!elementsToAdd.isEmpty() && !components.isEmpty()) {
- int lastIndex = getIndexAfter(rootElement, COMPONENT);
- rootElement.addContent(lastIndex, elementsToAdd);
-
- } else if (!elementsToAdd.isEmpty()) {
+ if (!elementsToAdd.isEmpty()) {
// if facesconfig contains no component section add the components after factory or application
- int lastIndex = getIndexAfter(rootElement, FACTORY);
- if (lastIndex == 0) {
- lastIndex = getIndexAfter(rootElement, APPLICATION);
- }
+ int lastIndex = getIndexAfter(rootElement, COMPONENT, FACTORY, APPLICATION);
rootElement.addContent(lastIndex, elementsToAdd);
}
+ if (!newConverters.isEmpty()) {
+ int lastIndex = getIndexAfter(rootElement, CONVERTER, COMPONENT, FACTORY, APPLICATION);
+ rootElement.addContent(lastIndex, newConverters);
+ }
+ if (!newValidators.isEmpty()) {
+ rootElement.addContent(newValidators);
+ }
document.setDocType(new DocType("faces-config",
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN",
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd"));
@@ -163,12 +181,13 @@
StringWriter facesConfig = new StringWriter();
Format format = Format.getPrettyFormat();
- format.setLineSeparator(SEPERATOR);
+ format.setLineSeparator(SEPARATOR);
XMLOutputter out = new XMLOutputter(format);
out.output(document, facesConfig);
// TODO: is this replace really necessary?
- String facesConfigStr = facesConfig.toString().replaceFirst(" xmlns=\"http://java.sun.com/JSF/Configuration\"", "");
+ String facesConfigStr =
+ facesConfig.toString().replaceFirst(" xmlns=\"http://java.sun.com/JSF/Configuration\"", "");
writer.append(facesConfigStr);
} catch (JDOMException e) {
@@ -181,17 +200,66 @@
}
}
+ private void addConverter(ClassDeclaration decl, List<Element> newConverters, Namespace namespace) {
+ Converter converterAnn = decl.getAnnotation(Converter.class);
+ Element converter = new Element(CONVERTER, namespace);
+ if (converterAnn.id().length() > 0) {
+ Element converterId = new Element(CONVERTER_ID, namespace);
+ converterId.setText(converterAnn.id());
+ converter.addContent(converterId);
+ } else if (converterAnn.forClass().length() > 0) {
+ Element converterForClass = new Element(CONVERTER_FOR_CLASS, namespace);
+ converterForClass.setText(converterAnn.forClass());
+ converter.addContent(converterForClass);
+ }
+
+ Element converterClass = new Element(CONVERTER_CLASS, namespace);
+ converterClass.setText(decl.getQualifiedName());
+ converter.addContent(converterClass);
+ newConverters.add(converter);
+ }
+
+ private void addValidator(ClassDeclaration decl, List<Element> newValidators, Namespace namespace) {
+ Validator validatorAnn = decl.getAnnotation(Validator.class);
+ System.err.println("validator");
+ Element validator = new Element(VALIDATOR, namespace);
+ if (validatorAnn.id().length() > 0) {
+ Element validatorId = new Element(VALIDATOR_ID, namespace);
+ validatorId.setText(validatorAnn.id());
+ validator.addContent(validatorId);
+ } else if (validatorAnn.forClass().length() > 0) {
+ Element validatorForClass = new Element(VALIDATOR_FOR_CLASS, namespace);
+ validatorForClass.setText(validatorAnn.forClass());
+ validator.addContent(validatorForClass);
+ }
+
+ Element validatorClass = new Element(VALIDATOR_CLASS, namespace);
+ validatorClass.setText(decl.getQualifiedName());
+ validator.addContent(validatorClass);
+ newValidators.add(validator);
+ }
+
private boolean containsElement(List<Element> components, Element newElement) {
- boolean found = false;
+ return getEqualElement(components, newElement)!=null;
+ }
+
+ private Element getEqualElement(List<Element> components, Element newElement) {
for (Element element: components) {
if (equals(element, newElement)) {
- found = true;
- break;
+ return element;
}
}
- return found;
+ return null;
+ }
+ private int getIndexAfter(Element rootElement, String...tagNames) {
+ for (String tagName: tagNames) {
+ int index = getIndexAfter(rootElement, tagName);
+ if (index != 0) {
+ return index;
+ }
+ }
+ return 0;
}
-
private int getIndexAfter(Element rootElement, String tagName) {
List<Element> components = rootElement.getChildren(tagName, rootElement.getNamespace());
if (!components.isEmpty()) {
@@ -222,7 +290,7 @@
Element elementClass = new Element(COMPONENT_CLASS, namespace);
elementClass.setText(componentTag.uiComponent());
element.addContent(elementClass);
- addFacets(componentTag, namespace, element);
+
return element;
}
@@ -355,6 +423,7 @@
Element element = createElement(decl, componentTag, uiComponentClass, namespace);
if (element != null) {
if (!containsElement(components, element)) {
+ addFacets(componentTag, namespace, element);
List attributes = new ArrayList();
List properties = new ArrayList();
addAttributes(decl, uiComponentClass, attributes, properties, namespace);
@@ -365,7 +434,10 @@
element.addContent(properties);
}
components.add(element);
+ } else {
+ // TODO add facet and attributes
}
+
}
} catch (Exception e) {
e.printStackTrace();
@@ -381,6 +453,7 @@
Element element = createElement(decl, componentTag, uiComponentClass, namespace);
if (element != null) {
if (!containsElement(components, element)) {
+ addFacets(componentTag, namespace, element);
List attributes = new ArrayList();
List properties = new ArrayList();
addAttributes(decl, uiComponentClass, properties, attributes, namespace);
@@ -391,6 +464,8 @@
element.addContent(properties);
}
components.add(element);
+ } else {
+ // TODO add facet and attributes
}
}
} catch (Exception e) {
@@ -403,7 +478,7 @@
for ( Iterator i = document.getDescendants( new ContentFilter( ContentFilter.COMMENT ) );
i.hasNext(); ) {
Comment c = (Comment) i.next();
- c.setText( c.getText().replaceAll( "\n", SEPERATOR ) );
+ c.setText( c.getText().replaceAll( "\n", SEPARATOR) );
}
}
}