@Override public void decode(final InputStream in, final ParameterFactory factory, final SccpProtocolVersion sccpProtocolVersion) throws ParseException { try { int b = in.read() & 0xff; this.natureOfAddress = NatureOfAddress.valueOf(b & 0x7f); if((b & 0x80) >0){ super.encodingScheme = BCDOddEncodingScheme.INSTANCE; } else { super.encodingScheme = BCDEvenEncodingScheme.INSTANCE; } super.digits = this.encodingScheme.decode(in); } catch (IOException e) { throw new ParseException(e); } }
@Override public void decode(final InputStream in,final ParameterFactory factory, final SccpProtocolVersion sccpProtocolVersion) throws ParseException { try{ this.translationType = in.read() & 0xff; int b = in.read() & 0xff; this.encodingScheme = factory.createEncodingScheme((byte) (b & 0x0f)); this.numberingPlan = NumberingPlan.valueOf((b & 0xf0) >> 4); b = in.read() & 0xff; this.natureOfAddress = NatureOfAddress.valueOf(b); super.digits = this.encodingScheme.decode(in); } catch (IOException e) { throw new ParseException(e); } }
public void read(InputElement xml, GlobalTitle0001Impl ai) throws XMLStreamException { // ai.gti = GlobalTitleIndicator.valueOf(xml.getAttribute(GLOBALTITLE_INDICATOR).toInt()); try { ai.natureOfAddress = NatureOfAddress.valueOf(xml.getAttribute(NATURE_OF_ADDRESS_INDICATOR).toInt()); } catch (IllegalArgumentException e) { throw new XMLStreamException(e); } ai.digits = xml.getAttribute(DIGITS).toString(); } };
@Override public void setNatureOfAddress(NatureOfAddressType val) { this.testerHost.getConfigurationData().getSccpConfigurationData() .setNatureOfAddress(NatureOfAddress.valueOf(val.intValue())); this.testerHost.markStore(); }
NatureOfAddress naiObj = NatureOfAddress.valueOf(nao);
NatureOfAddress nai = NatureOfAddress.valueOf(naiValue);
public void read(InputElement xml, GlobalTitle0100Impl ai) throws XMLStreamException { try { ai.translationType = xml.getAttribute(TRANSLATION_TYPE).toInt(); //wrong... final byte esCode = (byte) xml.getAttribute(ENCODING_SCHEME).toInt(); ai.encodingScheme = factory.createEncodingScheme(esCode); ai.numberingPlan = NumberingPlan.valueOf(xml.getAttribute(NUMBERING_PLAN).toInt()); ai.natureOfAddress = NatureOfAddress.valueOf(xml.getAttribute(NATURE_OF_ADDRESS_INDICATOR).toInt()); ai.digits = xml.getAttribute(DIGITS).toString(); } catch (Exception e) { throw new XMLStreamException(e); } } };
public void read(InputElement xml, SccpConfigurationData_OldFormat sccp) throws XMLStreamException { sccp.setRouteOnGtMode(xml.getAttribute(REMOTE_ON_GT_MODE).toBoolean()); sccp.setRemoteSpc(xml.getAttribute(REMOTE_SPC).toInt()); sccp.setLocalSpc(xml.getAttribute(LOCAL_SPC).toInt()); sccp.setNi(xml.getAttribute(NI).toInt()); sccp.setRemoteSsn(xml.getAttribute(REMOTE_SSN).toInt()); sccp.setLocalSsn(xml.getAttribute(LOCAL_SSN).toInt()); sccp.setTranslationType(xml.getAttribute(TRANSLATION_TYTE).toInt()); String gtt = (String) xml.get(GLOBAL_TITLE_TYPE, String.class); sccp.setGlobalTitleType(GlobalTitleType.createInstance(gtt)); String an = (String) xml.get(ADDRESS_NATURE, String.class); sccp.setNatureOfAddress(NatureOfAddress.valueOf(an)); String np = (String) xml.get(NUMBERING_PLAN, String.class); sccp.setNumberingPlan(NumberingPlan.valueOf(np)); sccp.setCallingPartyAddressDigits((String) xml.get(CALLING_PARTY_ADDRESS_DIGITS, String.class)); // for skipping previous data String extraLocalAddressDigits = (String) xml.get(EXTRA_LOCAL_ADDRESS_DIGITS, String.class); } };
public void read(InputElement xml, SccpConfigurationData sccp) throws XMLStreamException { sccp.setRouteOnGtMode(xml.getAttribute(REMOTE_ON_GT_MODE).toBoolean()); sccp.setRemoteSpc(xml.getAttribute(REMOTE_SPC).toInt()); sccp.setLocalSpc(xml.getAttribute(LOCAL_SPC).toInt()); sccp.setNi(xml.getAttribute(NI).toInt()); sccp.setRemoteSsn(xml.getAttribute(REMOTE_SSN).toInt()); sccp.setLocalSsn(xml.getAttribute(LOCAL_SSN).toInt()); CharArray ca = xml.getAttribute(LOCAL_SSN2); if (ca != null) sccp.setLocalSsn2(ca.toInt()); sccp.setTranslationType(xml.getAttribute(TRANSLATION_TYTE).toInt()); String gtt = (String) xml.get(GLOBAL_TITLE_TYPE, String.class); sccp.setGlobalTitleType(GlobalTitleType.createInstance(gtt)); String an = (String) xml.get(ADDRESS_NATURE, String.class); sccp.setNatureOfAddress(NatureOfAddress.valueOf(an)); String np = (String) xml.get(NUMBERING_PLAN, String.class); sccp.setNumberingPlan(NumberingPlan.valueOf(np)); String spv = (String) xml.get(SCCP_PROTOCOL_VERSION, String.class); if (spv != null) sccp.setSccpProtocolVersion(SccpProtocolVersion.valueOf(spv)); sccp.setCallingPartyAddressDigits((String) xml.get(CALLING_PARTY_ADDRESS_DIGITS, String.class)); } };