blob: 66ef80569195e21797902381db2593ceb169478d [file] [log] [blame]
ohair92de5662012-04-10 08:22:03 -07001#! /bin/sh
2#
alanb0d058232012-11-02 15:50:11 +00003# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
ohair92de5662012-04-10 08:22:03 -07004# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5#
6# This code is free software; you can redistribute it and/or modify it
7# under the terms of the GNU General Public License version 2 only, as
8# published by the Free Software Foundation. Oracle designates this
9# particular file as subject to the "Classpath" exception as provided
10# by Oracle in the LICENSE file that accompanied this code.
11#
12# This code is distributed in the hope that it will be useful, but WITHOUT
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15# version 2 for more details (a copy is included in the LICENSE file that
16# accompanied this code).
17#
18# You should have received a copy of the GNU General Public License version
19# 2 along with this work; if not, write to the Free Software Foundation,
20# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21#
22# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23# or visit www.oracle.com if you need additional information or have any
24# questions.
25#
26
27# Generate exception classes
28
29SPEC=$1
30DST=$2
31
32gen() {
33 ID=$1
34 WHAT=$2
ihsea29e6222013-10-10 15:06:21 +020035 SVUID=$3
ohair92de5662012-04-10 08:22:03 -070036 ARG_TYPE=$4
37 ARG_ID=$5
38 ARG_PROP=$6
39 ARG_PHRASE=$7
40 ARG_PARAM="$ARG_TYPE$ $ARG_ID"
41 echo '-->' $DST/$ID.java
42 out=$DST/${ID}.java
43
erikje78df742012-06-07 20:40:50 -070044 $SH ${SCRIPTS}/addNotices.sh "$COPYRIGHT_YEARS" > $out
ohair92de5662012-04-10 08:22:03 -070045
ihsea29e6222013-10-10 15:06:21 +020046 cat >>$out <<__END__
ohair92de5662012-04-10 08:22:03 -070047
48// -- This file was mechanically generated: Do not edit! -- //
49
50package $PACKAGE;
51
52
53/**$WHAT
54 *
55 * @since $SINCE
56 */
57
58public `if [ ${ABSTRACT:-0} = 1 ];
59 then echo 'abstract '; fi`class $ID
60 extends ${SUPER}
61{
62
63 private static final long serialVersionUID = $SVUID;
64__END__
65
66 if [ $ARG_ID ]; then
67
68 cat >>$out <<__END__
69
70 private $ARG_TYPE $ARG_ID;
71
72 /**
alanb29e76dc2013-06-12 08:04:11 +010073 * Constructs an instance of this class.
ohair92de5662012-04-10 08:22:03 -070074 *
75 * @param $ARG_ID
76 * The $ARG_PHRASE
77 */
78 public $ID($ARG_TYPE $ARG_ID) {
79 super(String.valueOf($ARG_ID));
80 this.$ARG_ID = $ARG_ID;
81 }
82
83 /**
alanb29e76dc2013-06-12 08:04:11 +010084 * Retrieves the $ARG_PHRASE.
ohair92de5662012-04-10 08:22:03 -070085 *
86 * @return The $ARG_PHRASE
87 */
88 public $ARG_TYPE get$ARG_PROP() {
89 return $ARG_ID;
90 }
91
92}
93__END__
94
95 else
96
97 cat >>$out <<__END__
98
99 /**
100 * Constructs an instance of this class.
101 */
102 public $ID() { }
103
104}
105__END__
106
107 fi
108}
109
110. $SPEC