1 29 30 package com.caucho.relaxng.pattern; 31 32 import com.caucho.relaxng.RelaxException; 33 import com.caucho.util.L10N; 34 35 38 abstract public class NameClassPattern extends Pattern { 39 protected static final L10N L = new L10N(NameClassPattern.class); 40 41 44 public void setParent(Pattern parent) 45 throws RelaxException 46 { 47 if (! (parent instanceof NameClassPattern) && 48 ! (parent instanceof ElementPattern) && 49 ! (parent instanceof AttributePattern)) { 50 throw new RelaxException(L.l("{0} is not allowed as a child of {1}", 51 getTagName(), parent.getTagName())); 52 } 53 54 super.setParent(parent); 55 } 56 } 57 | Popular Tags |