01: package org.kohsuke.rngom.parse.host;
02:
03: import org.kohsuke.rngom.ast.builder.Annotations;
04: import org.kohsuke.rngom.ast.om.Location;
05:
06: /**
07: *
08: * @author
09: * Kohsuke Kawaguchi (kk@kohsuke.org)
10: */
11: public class Base {
12: protected AnnotationsHost cast(Annotations ann) {
13: if (ann == null)
14: return nullAnnotations;
15: else
16: return (AnnotationsHost) ann;
17: }
18:
19: protected LocationHost cast(Location loc) {
20: if (loc == null)
21: return nullLocation;
22: else
23: return (LocationHost) loc;
24: }
25:
26: private static final AnnotationsHost nullAnnotations = new AnnotationsHost(
27: null, null);
28: private static final LocationHost nullLocation = new LocationHost(
29: null, null);
30: }
|