title: Why Jackson library internal implementation utilizing the getter call for engendering the Json
body: <p>I have the below piece of the code for engendering the Json.</p>
  
  <pre><code>class Student {
     private String name;
     private int age;
     public Student(){}
     public String getName() {
        return name;
     }
     public void setName(String name) {
        this.name = name;
     }
     public int getAge() {
        return age;
     }
     public void setAge(int age) {
        this.age = age;
     }
     public String toString(){
        return "Student [ name: "+name+", age: "+ age+ " ]";
     }
  }
  </code></pre>
  
  <p>Now for creating the Json i need to write the code like below.</p>
  
  <pre><code>  ObjectMapper mapper = new ObjectMapper();
        String jsonString = "{\"name\":\"Mahesh\", \"age\":21}";
  
        //map json to student
        try{
           Student student = mapper.readValue(jsonString, Student.class);
  
           System.out.println(student);
  
           jsonString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(student);
  
           System.out.println(jsonString);
        }
        catch (JsonParseException e) { e.printStackTrace();}
        catch (JsonMappingException e) { e.printStackTrace(); }
        catch (IOException e) { e.printStackTrace(); }
     }
  </code></pre>
  
  <p>Now why Jackson library internally utilizing the getter method for json engenderment.</p>