public String nameOf(int tag) { if ((tag & 0x0000ffff) == 0) // Group Length return ElementDictionary.GROUP_LENGTH; ElementDictionary dict; if ((tag & 0x00010000) != 0) { // Private Element if ((tag & 0x0000ff00) == 0) return ElementDictionary.PRIVATE_CREATOR; final String privateCreatorID = getPrivateCreator(tag); if (privateCreatorID == null) return ElementDictionary.getUnkown(); dict = ElementDictionary.getPrivateDictionary(privateCreatorID); } else { dict = ElementDictionary.getDictionary(); } return dict.nameOf(tag); }
public static void loadDictionary(String resourceName) { ElementDictionary d = (ElementDictionary) ResourceLocator .loadResource(resourceName); if (d.getPrivateCreator() == null) { ElementDictionary.stdDict = d; } else { ElementDictionary.privDicts.put(d.getPrivateCreator(), d); } }
public static ElementDictionary getDictionary() { return maskNull(stdDict); }
if (!ElementDictionary.getDictionary().nameOf(element.tag()).contains("Sequence")) queryParams += ElementDictionary.getDictionary().nameOf(element.tag()) + " - " + element.getValueAsString(new SpecificCharacterSet("UTF-8"), 0) + " ";
public static void main(String args[]) { if (args.length < 2) { System.out.println(USAGE); System.exit(1); } ElementDictionary dict = new ElementDictionary(2300); try { dict.loadXML(new File(args[0])); if (args.length > 2) { ResourceLocator .createResource(args[1], dict, new File(args[2])); System.out.println("Create Dictionary Resource - " + args[2]); } else { ResourceLocator.serializeTo(dict, new File(args[1])); System.out.println("Serialize Dictionary to - " + args[1]); } } catch (Exception e) { e.printStackTrace(); } }
public static ElementDictionary getPrivateDictionary(String creatorID) { return maskNull(creatorID != null && creatorID.length() != 0 ? (ElementDictionary) privDicts .get(creatorID) : stdDict); }
public static void reloadDictionaries() { ElementDictionary newStdDict = null; Hashtable<String, ElementDictionary> newPrivDicts = new Hashtable<String, ElementDictionary>(); List<String> list = ResourceLocator.findResources(ElementDictionary.class); for (int i = 0, n = list.size(); i < n; ++i) { ElementDictionary d = (ElementDictionary) ResourceLocator.loadResource(list.get(i)); if (d.getPrivateCreator() == null) { newStdDict = d; } else { newPrivDicts.put(d.getPrivateCreator(), d); } } ElementDictionary.stdDict = newStdDict; ElementDictionary.privDicts = newPrivDicts; }