1 package org.apache.maven.model.io.xpp3;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.io.IOException;
23 import java.io.OutputStream;
24 import java.io.Writer;
25 import org.apache.maven.model.Model;
26
27 public class MavenXpp3Writer
28 {
29 //--------------------------/
30 //- Class/Member Variables -/
31 //--------------------------/
32
33 /**
34 * Field fileComment.
35 */
36 private String fileComment = null;
37
38
39 //-----------/
40 //- Methods -/
41 //-----------/
42
43 /**
44 * Method setFileComment.
45 *
46 * @param fileComment a fileComment object.
47 */
48 public void setFileComment( String fileComment )
49 {
50 this.fileComment = fileComment;
51 } //-- void setFileComment( String )
52
53 /**
54 * Method write.
55 *
56 * @param writer a writer object.
57 * @param model a model object.
58 * @throws IOException java.io.IOException if any.
59 */
60 public void write( Writer writer, Model model )
61 throws IOException
62 {
63 org.apache.maven.model.v4.MavenXpp3Writer xw = new org.apache.maven.model.v4.MavenXpp3Writer();
64 xw.setFileComment( fileComment );
65 xw.write( writer, model.getDelegate() );
66 } //-- void write( Writer, Model )
67
68 /**
69 * Method write.
70 *
71 * @param stream a stream object.
72 * @param model a model object.
73 * @throws IOException java.io.IOException if any.
74 */
75 public void write( OutputStream stream, Model model )
76 throws IOException
77 {
78 org.apache.maven.model.v4.MavenXpp3Writer xw = new org.apache.maven.model.v4.MavenXpp3Writer();
79 xw.setFileComment( fileComment );
80 xw.write( stream, model.getDelegate() );
81 } //-- void write( OutputStream, Model )
82
83 }