1 19 package org.netbeans.modules.xml.tools.generator; 20 21 import java.util.*; 22 23 import org.netbeans.tax.*; 24 25 31 public class ElementDeclarations extends HashMap { 32 33 34 private static final long serialVersionUID =2385299250969298335L; 35 36 39 public ElementDeclarations(Iterator it) { 40 if (it == null) return; 41 while (it.hasNext()) { 42 TreeElementDecl next = (TreeElementDecl) it.next(); 43 put(next.getName(), new Entry(next.allowText(), next.allowElements())); 44 } 45 } 46 47 50 public final Entry getEntry(String element) { 51 return (Entry) get(element); 52 } 53 54 57 public static class Entry { 58 59 public static final int EMPTY = 0; 60 public static final int DATA = 1; 61 public static final int CONTAINER = 2; 62 public static final int MIXED = 3; 63 64 private int type; 65 66 public Entry(boolean at, boolean ae) { 67 type = at ? DATA : 0; 68 type += ae ? CONTAINER : 0; 69 } 70 71 public int getType() { 72 return type; 73 } 74 } 75 } 76 | Popular Tags |