[ 
https://issues.apache.org/jira/browse/PIVOT-578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12891135#action_12891135
 ] 

Greg Brown commented on PIVOT-578:
----------------------------------

I have a couple of questions about this ticket:

1) Where might such an annotation be applied (i.e. to what class or method)?

2) What entity would be responsible for processing the annotation?

3) What would processing the annotation do? BXML isn't compiled - the only way 
to validate it is to attempt to load it. If you try to write a compiler (or 
"verifier"), you'll probably end up re-writing BXMLSerializer.

It might make more sense to implement this as an IDE plugin or Ant task rather 
than an annotation. At build time, this task could simply load the BXML using 
BXMLSerializer and verify that no exceptions are thrown. However, there are 
potential issues with that approach as well - since it is possible to 
pre-populate the serializer's namespace, you'd need to know in advance what 
values your application wanted to put in the namespace. Your verifier would 
need to support this somehow (which could actually be impossible, since those 
values could be generated programmatically), or it would need to document that 
it does not support namespace pre-population.

So, while I understand the motivation behind this feature, it may be misguided. 
BXML is fundamentally a runtime construct (like HTML). It may be that the best 
way to test your BXML is by running your application.


> create an annotation to check at compile time bxml files
> --------------------------------------------------------
>
>                 Key: PIVOT-578
>                 URL: https://issues.apache.org/jira/browse/PIVOT-578
>             Project: Pivot
>          Issue Type: New Feature
>            Reporter: Sandro Martini
>            Assignee: Sandro Martini
>            Priority: Minor
>
> In some cases could be useful to have an optional annotation to check (but at 
> compile time) bxml files, so when application grows, less tests should be 
> done by hand. This could be a great plus.
> For example checks could be more, ranging from existence of the resource 
> file, to check for a well-formed structure, to a well-formed contents (if 
> possible) ...
> At the moment this is only an experimental (optional) feature.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to