Results 1 to 4 of 4
  1. #1
    kmun is offline Member
    Join Date
    Aug 2015
    Posts
    2
    Rep Power
    0

    Post Namechecker in java for parser

    Hello all,
    I am new to java programming presently i am working on a parser. created a html table for parser file values. now i have to create a namechecker class to read parser. Kindly help me i am attaching the code here.,
    public class Namechecker {
    public static void check(Map<String, A2LObject> a2lObjects, boolean throwError) throws InvalidNameException {
    for(A2LObject obj : a2lObjects.values()) {
    if(!checkName()) {
    if(throwError) {
    throw new InvalidNameException(obj.getName() + " does not match the naming styleguides!");
    } else {
    obj.setHasError(true);
    }
    }
    }
    }
    Now i have to write a function to check with 1) Upper case, Character ' _'
    Kindly help me.
    Thanks & Regards
    Karthik

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

    Default Re: Namechecker in java for parser

    What problems are you having?

    Please edit your post and wrap the code in code tags.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    kmun is offline Member
    Join Date
    Aug 2015
    Posts
    2
    Rep Power
    0

    Default Re: Namechecker in java for parser

    Quote Originally Posted by kmun View Post
    Hello all,
    I am new to java programming presently i am working on a parser. created a html table for parser file values. now i have to create a namechecker class to read parser. Kindly help me i am attaching the code here.,



    public class Namechecker {
    public static void check(Map<String, A2LObject> a2lObjects, boolean throwError) throws InvalidNameException {
    for(A2LObject obj : a2lObjects.values()) {
    if(!checkName()) {
    if(throwError) {
    throw new InvalidNameException(obj.getName() + " does not match the naming styleguides!");
    } else {
    obj.setHasError(true);
    }
    }
    }
    }
    Now i have to write a function to check with 1) Upper case, Character ' _'
    Kindly help me.
    Thanks & Regards
    Karthik
    Hi norm.. now i dont know how to write a function such that when i type a uppercase, character or _ it should dispay otherwise it should return false.

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

    Default Re: Namechecker in java for parser

    how to write a function such that when i type a uppercase, character or _ it should dispay otherwise it should return false.
    Are there two parts there?
    1) read the what the user has entered - See the Scanner class for methods to read user input
    2) look at the contents of the String the user entered - See the String class for methods to look at the contents of a String. Also the Character class has methods to detect the case of a character
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. help on java mozilla html parser.....
    By nijil in forum New To Java
    Replies: 7
    Last Post: 03-01-2010, 06:49 PM
  2. DOM Parser for xml file in java
    By Ms.Ranjan in forum XML
    Replies: 2
    Last Post: 09-18-2009, 04:21 PM
  3. Java Mozilla Html Parser 0.1.7
    By levent in forum Java Software
    Replies: 0
    Last Post: 07-30-2007, 04:30 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
  •