public void parseDictionary(InputStream is) throws Exception { // we override default conf here. this.stackDictionary = (DictionaryImpl) DictionarySingleton.getDictionary(is); this.avpMap.clear(); this.nameToCodeMap.clear(); //dont like that.... // fill AVP Map for (org.jdiameter.api.validation.AvpRepresentation value:this.stackDictionary.getAvpMap().values()) { AvpRepresentation avp = new AvpRepresentation((AvpRepresentationImpl) value); this.avpMap.put(avp, avp); this.nameToCodeMap.put(avp.getName(), avp); } }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("name: ").append(this.getName()).append(", code: ").append(this.getCode()).append(", vendor: ").append(this.getVendorId()).append(", weak: ") .append(this.isWeak()).append(", grouped: ").append(this.isGrouped()).append(", type: ").append(this.getType()).append(", multiplicity: ") .append(this.getMultiplicityIndicator()); if (this.isGrouped()) { for (AvpRepresentation child : this.getChildren()) { String childStr = child.toString().replace("\n", "\n---"); sb.append("\n---" + childStr); } } return sb.toString(); }
public void parseDictionary(InputStream is) throws Exception { // we override default conf here. this.stackDictionary = (DictionaryImpl) DictionarySingleton.getDictionary(); this.avpMap.clear(); this.nameToCodeMap.clear(); //dont like that.... // fill AVP Map Map<org.jdiameter.api.validation.AvpRepresentation, org.jdiameter.api.validation.AvpRepresentation> map = this.stackDictionary.getAvpMap(); for(org.jdiameter.api.validation.AvpRepresentation key:map.keySet()) { AvpRepresentationImpl value = (AvpRepresentationImpl) map.get(key); AvpRepresentation avp = new AvpRepresentation(value); this.avpMap.put(avp, avp); this.nameToCodeMap.put(avp.getName(),avp); } }
@Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("name: ").append(this.getName()).append(", code: ").append(this.getCode()).append(", vendor: ").append(this.getVendorId()).append(", weak: ") .append(this.isWeak()).append(", grouped: ").append(this.isGrouped()).append(", type: ").append(this.getType()).append(", multiplicity: ") .append(this.getMultiplicityIndicator()); if (this.isGrouped()) { for (AvpRepresentation child : this.getChildren()) { String childStr = child.toString().replace("\n", "\n---"); sb.append("\n---" + childStr); } } return sb.toString(); }