Examples of SxmpErrorException


Examples of com.cloudhopper.sxmp.SxmpErrorException

        // try to parse the type first
        MobileAddress.Type addrType = MobileAddressUtil.parseType(type);

        // check if the type was valid.
        if (addrType == null) {
            throw new SxmpErrorException(SxmpErrorCode.UNABLE_TO_CONVERT_VALUE, "The address type [" + type + "] is not valid");
        }

        // creates a new mobile address, also validates syntax of them too
        return new MobileAddress(addrType, address);
    }
View Full Code Here

Examples of com.cloudhopper.sxmp.SxmpErrorException

    }

    static public void validateNetworkAddress(String value) throws SxmpErrorException {
        for (int i = 0; i < value.length(); i++) {
            if (!Character.isDigit(value.charAt(i))) {
                throw new SxmpErrorException(SxmpErrorCode.UNABLE_TO_CONVERT_VALUE, "Network address contained an invalid character [" + value.charAt(i) + "]");
            }
        }
    }
View Full Code Here

Examples of com.cloudhopper.sxmp.SxmpErrorException

    }

    static public void validateInternationalAddress(String value) throws SxmpErrorException {
        // make sure address is at least 2 digits long
        if (value.length() < 2) {
            throw new SxmpErrorException(SxmpErrorCode.UNABLE_TO_CONVERT_VALUE, "International address must be at least 2 characters in length");
        }

        // first character must be +
        if (value.charAt(0) != '+') {
            throw new SxmpErrorException(SxmpErrorCode.UNABLE_TO_CONVERT_VALUE, "International address must start with '+' character followed by country dialing code and national number");
        }

        for (int i = 1; i < value.length(); i++) {
            if (!Character.isDigit(value.charAt(i))) {
                throw new SxmpErrorException(SxmpErrorCode.UNABLE_TO_CONVERT_VALUE, "International address contained an invalid character [" + value.charAt(i) + "]");
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.