~~ Licensed to the Apache Software Foundation (ASF) under one or more | |
~~ contributor license agreements. See the NOTICE file distributed with | |
~~ this work for additional information regarding copyright ownership. | |
~~ The ASF licenses this file to You 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. | |
------ | |
Doclets and Annotations | |
------ | |
Doclets and Annotations | |
To annotate the necessary information in | |
component / converter / validator / renderkit / renderer / tag files | |
you can use doclets: | |
------------------- | |
/** | |
* This is a doclet | |
* | |
* @JSFProperty | |
* required = "true" | |
* defaultValue = "AnyValue" | |
**/ | |
------------------- | |
or annotations | |
------------------- | |
/** | |
* This is an annotation | |
* | |
**/ | |
@JSFProperty( | |
required = true, | |
defaultValue = "AnyValue") | |
------------------- | |
Doclets and annotations can be used on both jsf 1.1 and jsf 1.2, but | |
since jsf 1.1 is jdk 1.4 compatible, it is preferred to use doclets with | |
jsf 1.1 (note that if you use annotations, your source code should be | |
jdk 1.5 in order to compile). | |
The differences between doclets and annotations are listed below: | |
* Attribute names like "class", "implements" in annotated | |
version are "clazz" and "implementz". | |
* All attribute values in doclets must be between "". In annotations | |
boolean attributes must not (see "required" example below). | |
* Usage of annotations like @JSFJspProperties and @JSFRenderers are | |
not required on doclets. | |
Taking into account the previous differences, you can consult the | |
annotation javadoc for doclets. | |