Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By jim829

Thread: I need help of java code that is attached on the body of this email

  1. #1
    Phila is offline Member
    Join Date
    Aug 2015
    Posts
    3
    Rep Power
    0

    Default I need help of java code that is attached on the body of this email

    The first two digits of the 'Place of loading' and 'Place of unloading' shall consist of the country code
    followed by the name of a seaport, airport, freight terminal, rail station or other place. I just want to add this specification on the code below "followed by the name of a seaport, airport, freight terminal, rail station or other place"
    CODE is as follows:
    protected Issue ruleR670(String loading, String where, int occurence, String type){
    02
    boolean valid = true;
    03
    if(loading == null)
    04
    throw new NullPointerException("laoding parameter cannot be null");
    05
    if (loading.length() < 2) {
    06
    valid = false; // too short to substring
    07
    } else {
    08
    String countryCode = loading.substring(0, 2);
    09
    valid = isCodeInCodeList(countryCode, COUNTRY_CODES_CODELIST);
    10
    }
    11
    if (!valid) {
    12
    Issue issue = IssueFactory.getInstance().createIssue(IcsCodes.I1 011, loading);
    13
    issue.setErrorReason(ERROR_REASON);
    14
    if(occurence == 0)
    15
    issue.setErrorPointer(where+"."+type);
    16
    else
    17
    issue.setErrorPointer(where+"("+occurence+")."+typ e);
    18
    return issue;
    19
    }
    20

    21
    return null;
    22
    }
    23

    24
    /**
    25
    * The first two digits should be a valid EU country code followed by at least one character.
    26
    * @param loading
    27
    * @param where
    28
    * @param occurence
    29
    * @param type
    30
    * @throws NullPointerException if loading is null.
    31
    * @return
    32
    */
    33
    protected Issue lengthLessThanThreeCharacters(String loading, String where, int occurence, String type){
    34
    boolean valid = true;
    35
    if(loading == null)
    36
    throw new NullPointerException("laoding parameter cannot be null");
    37
    if (loading.length() < 3) {
    38
    valid = false; // too short according to DDNIA 7.0
    39
    }
    40
    if (!valid) {
    41
    Issue issue = IssueFactory.getInstance().createIssue(IcsCodes.I1 060, loading);
    42
    issue.setErrorReason(ERROR_REASON);
    43
    if(occurence == 0)
    44
    issue.setErrorPointer(where+"."+type);
    45
    else
    46
    issue.setErrorPointer(where+"("+occurence+")."+typ e);
    47
    return issue;
    48
    }
    49

    50
    return null;

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: I need help of java code that is attached on the body of this email

    Please edit your post and remove the numbers. They make the code very hard to read.
    Also please wrap the code in code tags.

    Did you have any specific questions about the code?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: I need help of java code that is attached on the body of this email

    Phila, the last time you started a thread here (and didn't return to) I asked you to go through the Forum Rules. If you continue to ignore the rules, you may be banned.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    Phila is offline Member
    Join Date
    Aug 2015
    Posts
    3
    Rep Power
    0

    Default Re: I need help of java code that is attached on the body of this email

    Hi DarryBurke,
    Thanks for coming back to me. Indeed I did not read the forum rules and I am sorry about that. Where can I get the rules, I just want to read them so that I can re-post my issue.
    Thanks

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: I need help of java code that is attached on the body of this email

    Quote Originally Posted by Phila View Post
    Hi DarryBurke
    ...Where can I get the rules...
    He provided a link to them in your first post.

    Regards,
    Jim
    DarrylBurke likes this.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Replies: 2
    Last Post: 06-08-2015, 12:04 AM
  2. Replies: 5
    Last Post: 10-27-2011, 07:47 AM
  3. send email using apache commons email
    By jnamendi in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 10-14-2008, 05:55 PM
  4. Replies: 5
    Last Post: 08-02-2008, 08:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •