01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.controls.api.bean;
20:
21: import com.sun.mirror.apt.AnnotationProcessorEnvironment;
22: import com.sun.mirror.declaration.Declaration;
23:
24: /**
25: * The ControlChecker interface is implemented by control authors wishing to
26: * enforce rich semantic validation on extension and field instance declarations of
27: * their controls. By supplying a ControlChecker implementation (a "checker")
28: * and associating it with your control's public interface, when an extension (.jcx)
29: * of your control is processed at build-time, the checker will be invoked and
30: * can do rich validation of the jcx type and field instances via introspection and
31: * analysis of the jcx's type structure, signatures and annotations.
32: * <p>
33: * Checkers are instantiated by, and required to implement, a no-arg constructor.
34: * They are provided with type information and context via the Sun mirror API.
35: */
36: public interface ControlChecker {
37: /**
38: * Invoked by the control build-time infrastructure to process a declaration of
39: * a control extension (ie, an interface annotated with @ControlExtension), or
40: * a field instance of a control type.
41: */
42: public void check(Declaration decl,
43: AnnotationProcessorEnvironment env);
44: }
|