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.netui.compiler.grammar;
20:
21: import org.apache.beehive.netui.compiler.AnnotationGrammar;
22: import org.apache.beehive.netui.compiler.Diagnostics;
23: import org.apache.beehive.netui.compiler.RuntimeVersionChecker;
24: import org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv;
25:
26: public abstract class ValidationRulesContainerGrammar extends
27: AnnotationGrammar {
28: protected ValidationRulesContainerGrammar(
29: CoreAnnotationProcessorEnv env, Diagnostics diags,
30: RuntimeVersionChecker rvc) {
31: super (env, diags, VERSION_9_0_STRING, rvc);
32:
33: addMemberGrammar(VALIDATE_REQUIRED_ATTR,
34: new ValidateRequiredGrammar(env, diags, rvc));
35: addMemberGrammar(VALIDATE_RANGE_ATTR, new ValidateRangeGrammar(
36: env, diags, rvc));
37: addMemberGrammar(VALIDATE_MIN_LENGTH_ATTR,
38: new BaseValidationRuleGrammar(env, diags, rvc,
39: new String[][] { { CHARS_ATTR } }));
40: addMemberGrammar(VALIDATE_MAX_LENGTH_ATTR,
41: new BaseValidationRuleGrammar(env, diags, rvc,
42: new String[][] { { CHARS_ATTR } }));
43: addMemberGrammar(VALIDATE_CREDIT_CARD_ATTR,
44: new BaseValidationRuleGrammar(env, diags, rvc));
45: addMemberGrammar(VALIDATE_EMAIL_ATTR,
46: new BaseValidationRuleGrammar(env, diags, rvc));
47: addMemberGrammar(VALIDATE_MASK_ATTR,
48: new BaseValidationRuleGrammar(env, diags, rvc,
49: new String[][] { { REGEX_ATTR } }));
50: addMemberGrammar(VALIDATE_DATE_ATTR,
51: new BaseValidationRuleGrammar(env, diags, rvc,
52: new String[][] { { PATTERN_ATTR } }));
53: addMemberGrammar(VALIDATE_TYPE_ATTR, new ValidateTypeGrammar(
54: env, diags, rvc));
55: addMemberGrammar(VALIDATE_VALID_WHEN_ATTR,
56: new ValidateValidWhenGrammar(env, diags, rvc));
57: addMemberGrammar(VALIDATE_URL_ATTR, new ValidateURLGrammar(env,
58: diags, rvc));
59: addMemberArrayGrammar(VALIDATE_CUSTOM_ATTR,
60: new ValidateCustomGrammar(env, diags, rvc));
61: }
62: }
|