IntArrayConverter.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright (c) 2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Copyright (C) 1996 Active Software, Inc.
* All rights reserved.
*
* @(#) IntArrayConverter.java 1.14 - last change made 07/25/97
*/
/**
* Converts array of int to a string and back again.
* The string representation is a single line of
* comma-separated numbers.
*
* @version 1.14, 07/25/97
*/
public class IntArrayConverter extends Converter {
/**
* Converts and array of int to a string representation.
*/
int[] a = (int[]) obj;
for (int i = 0; i < a.length; i++) {
if (i != (a.length-1))
}
} else {
return (/* NOI18N */"");
}
}
/**
* Converts a string to an array of int.
*
* @exception ParseException when one of the numbers
* is badly formatted
*/
if (s != null) {
s, /* NOI18N */",");
for (; st.hasMoreTokens(); ) {
try {
} catch (NumberFormatException e) {
/* JSTYLED */
throw new ParseException(Global.fmtMsg("sunsoft.jws.visual.rt.type.IntArrayConverter.BadFormatInteger", s));
}
}
return (retval);
}
}
return (null);
}
/**
* Converts an array of int (stored in an attribute) into a block
* of code that will create the array without using
* this converter at
* runtime.
*/
indent += 2;
indent -= 2;
}
/**
* Use convertToCodeBlock instead.
*/
return (/* NOI18N */"_tmp");
}
}