Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DocumentModel |
|
| 1.3636363636363635;1,364 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.doxia.docrenderer.document; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * Describes the overall document model. | |
15 | * | |
16 | * @version $Revision$ $Date$ | |
17 | */ | |
18 | 1 | public class DocumentModel implements java.io.Serializable { |
19 | ||
20 | ||
21 | //--------------------------/ | |
22 | //- Class/Member Variables -/ | |
23 | //--------------------------/ | |
24 | ||
25 | /** | |
26 | * Field outputName | |
27 | */ | |
28 | private String outputName; | |
29 | ||
30 | /** | |
31 | * Field meta | |
32 | */ | |
33 | private DocumentMeta meta; | |
34 | ||
35 | /** | |
36 | * Field toc | |
37 | */ | |
38 | private DocumentTOC toc; | |
39 | ||
40 | ||
41 | //-----------/ | |
42 | //- Methods -/ | |
43 | //-----------/ | |
44 | ||
45 | /** | |
46 | * Method equals | |
47 | * | |
48 | * @param other | |
49 | */ | |
50 | public boolean equals(Object other) | |
51 | { | |
52 | 0 | if ( this == other) |
53 | { | |
54 | 0 | return true; |
55 | } | |
56 | ||
57 | 0 | if ( !(other instanceof DocumentModel) ) |
58 | { | |
59 | 0 | return false; |
60 | } | |
61 | ||
62 | 0 | DocumentModel that = (DocumentModel) other; |
63 | 0 | boolean result = true; |
64 | 0 | result = result && ( getOutputName() == null ? that.getOutputName() == null : getOutputName().equals( that.getOutputName() ) ); |
65 | 0 | result = result && ( getMeta() == null ? that.getMeta() == null : getMeta().equals( that.getMeta() ) ); |
66 | 0 | result = result && ( getToc() == null ? that.getToc() == null : getToc().equals( that.getToc() ) ); |
67 | 0 | return result; |
68 | } //-- boolean equals(Object) | |
69 | ||
70 | /** | |
71 | * Get The Meta information properties. | |
72 | */ | |
73 | public DocumentMeta getMeta() | |
74 | { | |
75 | 11 | return this.meta; |
76 | } //-- DocumentMeta getMeta() | |
77 | ||
78 | /** | |
79 | * Get null | |
80 | */ | |
81 | public String getOutputName() | |
82 | { | |
83 | 3 | return this.outputName; |
84 | } //-- String getOutputName() | |
85 | ||
86 | /** | |
87 | * Get The TOC information properties. | |
88 | */ | |
89 | public DocumentTOC getToc() | |
90 | { | |
91 | 7 | return this.toc; |
92 | } //-- DocumentTOC getToc() | |
93 | ||
94 | /** | |
95 | * Method hashCode | |
96 | */ | |
97 | public int hashCode() | |
98 | { | |
99 | 0 | int result = 17; |
100 | long tmp; | |
101 | 0 | result = 37 * result + ( outputName != null ? outputName.hashCode() : 0 ); |
102 | 0 | result = 37 * result + ( meta != null ? meta.hashCode() : 0 ); |
103 | 0 | result = 37 * result + ( toc != null ? toc.hashCode() : 0 ); |
104 | 0 | return result; |
105 | } //-- int hashCode() | |
106 | ||
107 | /** | |
108 | * Set The Meta information properties. | |
109 | * | |
110 | * @param meta | |
111 | */ | |
112 | public void setMeta(DocumentMeta meta) | |
113 | { | |
114 | 1 | this.meta = meta; |
115 | 1 | } //-- void setMeta(DocumentMeta) |
116 | ||
117 | /** | |
118 | * Set null | |
119 | * | |
120 | * @param outputName | |
121 | */ | |
122 | public void setOutputName(String outputName) | |
123 | { | |
124 | 1 | this.outputName = outputName; |
125 | 1 | } //-- void setOutputName(String) |
126 | ||
127 | /** | |
128 | * Set The TOC information properties. | |
129 | * | |
130 | * @param toc | |
131 | */ | |
132 | public void setToc(DocumentTOC toc) | |
133 | { | |
134 | 0 | this.toc = toc; |
135 | 0 | } //-- void setToc(DocumentTOC) |
136 | ||
137 | /** | |
138 | * Method toString | |
139 | */ | |
140 | public java.lang.String toString() | |
141 | { | |
142 | 0 | StringBuffer buf = new StringBuffer(); |
143 | 0 | buf.append( "outputName = '" ); |
144 | 0 | buf.append( getOutputName() + "'" ); |
145 | 0 | buf.append( "\n" ); |
146 | 0 | buf.append( "meta = '" ); |
147 | 0 | buf.append( getMeta() + "'" ); |
148 | 0 | buf.append( "\n" ); |
149 | 0 | buf.append( "toc = '" ); |
150 | 0 | buf.append( getToc() + "'" ); |
151 | 0 | return buf.toString(); |
152 | } //-- java.lang.String toString() | |
153 | ||
154 | ||
155 | 1 | private String modelEncoding = "UTF-8"; |
156 | ||
157 | public void setModelEncoding( String modelEncoding ) | |
158 | { | |
159 | 0 | this.modelEncoding = modelEncoding; |
160 | 0 | } |
161 | ||
162 | public String getModelEncoding() | |
163 | { | |
164 | 0 | return modelEncoding; |
165 | } | |
166 | } |