View Javadoc

1   package org.apache.commons.digester3.examples.api.catalog;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   * 
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */ 
19  
20  /**
21   * See Main.java.
22   */
23  public class Book
24      implements Item
25  {
26  
27      private String isbn;
28  
29      private String title;
30  
31      private String author;
32  
33      private String desc;
34  
35      public Book( String isbn )
36      {
37          this.isbn = isbn;
38      }
39  
40      public void setTitle( String title )
41      {
42          this.title = title;
43      }
44  
45      public void setAuthor( String author )
46      {
47          this.author = author;
48      }
49  
50      public void setDesc( String desc )
51      {
52          this.desc = desc;
53      }
54  
55      public void print()
56      {
57          System.out.println( "Book:" );
58          System.out.println( "  isbn=" + isbn );
59          System.out.println( "  title=" + title );
60          System.out.println( "  author=" + author );
61          System.out.println( "  desc=" + desc );
62      }
63  
64  }