Chapter 1. Conventions

This document gives a quick overview of how to use the XML and annotation constructs available in JBoss AOP for users who have read through the rest of the documentation. It uses a somewhat non-standard notation, based on how you would actually use an xml snippet or annotation in your code, with optional and alternates marked. The values for attributes and elements have been left out, and for annotations taking only one value, the value should not be specified.

{a}

Item a between curly braces is optional.

[a]

Groups the items between the braces

[a | b]

Use a or b

multiplicity

The multiplicity symbols are the same as for a normal DTD

  • none - item should occur exactly once
  • ? - item should not occur, or occur once
  • * - item is optional and can occur several times
  • + - item must occur one or more times

The parts outside these markers should just be typed in as is.

For the following XML "definition":

            
   <test {optional} [choiceA | choiceB] compulsory >
      [ <subA></subA> | <subA></subA> ]?
   </test>
         </programlisting>
         These would be valid XML:
         <programlisting>
   <test choiceA="y" compulsory="c" >
      <subA>4</subA>
   </test>
   <test optional="x" choiceB="y" compulsory="c" >
      <subB>4</subB>
   </test>
   <test optional="x" choiceB="y" compulsory="c" />
         </programlisting>
           These would not be valid:
         <programlisting>
   <test choiceA="y" choiceB="y" compulsory="c" >
      <subA>4</subA>
   </test>

   <test choiceA="y" >
      <subA>4</subA>
   </test>

   <test choiceA="y" choiceB="y" compulsory="c" >
      <subA>4</subA>
   </test>

   <test choiceA="y" compulsory="c" >
      <subA>4</subA>
      <subB>4</subB>
   </test>

            
         

For the following annotation "definitions":

            
   @AnnA ( compulsory, [choiceA | choiceB] {, optional1})
   @AnnB (expr)
             
         

These would be valid uses, bearing in mind that for this example compulsory is a String, choiceA and choiceB are integers, optional1 is an array of Strings, and expr is a String:

            
   @AnnA ( compulsory="a", choiceA=3, optional1="a")
   @AnnA ( compulsory="a", choiceB=3, optional1="a", "b")
   @AnnA ( compulsory="a", choiceA=3)
   @AnnB ("a")
             
          

These would not be valid:

   @AnnA (choiceA=3, optional1={"a", b=""})
   @AnnA ( compulsory="a", choiceB=3, choiceB=3, optional1={"a", "b"})
   @AnnB (3)