01: /*
02: * Created on Mar 22, 2004
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.xssl.collection;
08:
09: import org.xdev.base.core.compiler.CompilerException;
10: import org.xdev.base.core.compiler.validator.AbstractValidator;
11: import org.xdev.base.xssl.XSSLComponent;
12:
13: public class SingleChildValidator extends AbstractValidator {
14:
15: /* (non-Javadoc)
16: * @see org.xdev.base.core.validate.AbstractValidator#validate(org.xdev.base.xssl.XSSLAction)
17: */
18: protected void validate(XSSLComponent component)
19: throws CompilerException {
20:
21: int count = 1;
22:
23: if (!component.hasProperty("reference-id")) {
24: count++;
25: }
26:
27: if (component.getCount() > count) {
28: throw new CompilerException(component.getLoggerId()
29: + " is a single child component!");
30: }
31: }
32: }
|