Changeset 1076 for trunk/src/xml/xsl/libcommon.xsl
- Timestamp:
- 07/10/08 10:24:52 (4 years ago)
- Files:
-
- 1 modified
-
trunk/src/xml/xsl/libcommon.xsl (modified) (29 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/xml/xsl/libcommon.xsl
r1056 r1076 584 584 585 585 /** 586 * Returns <code>true</code> if this <code><xsl:value-of select="$classname"/></code>587 * is equal to <tt>object</tt>.586 * Returns <code>true</code> if this <code><xsl:value-of select="$classname"/></code> 587 * is equal to <tt>object</tt>. 588 588 * @param object the object to compare to. 589 * @return <code>true</code> if this <code><xsl:value-of select="$classname"/></code>590 * is equal to <tt>object</tt>.589 * @return <code>true</code> if this <code><xsl:value-of select="$classname"/></code> 590 * is equal to <tt>object</tt>. 591 591 */ 592 592 public boolean equals (Object object) … … 895 895 { 896 896 /** 897 * The name of this type.897 * <xsl:value-of select="$classname"/> - the name of this type as string constant. 898 898 */ 899 899 public static final String TYPE_NAME = "<xsl:value-of select="$classname"/>"; 900 900 901 /** The minimal length of <xsl:value-of select="$classname"/> . */901 /** The minimal length of <xsl:value-of select="$classname"/> (<xsl:value-of select="$min-length"/>). */ 902 902 public static final int MIN_LENGTH = <xsl:value-of select="$min-length"/>; 903 903 904 /** The maximal length of <xsl:value-of select="$classname"/> . */904 /** The maximal length of <xsl:value-of select="$classname"/> (<xsl:value-of select="$max-length"/>). */ 905 905 public static final int MAX_LENGTH = <xsl:value-of select="$max-length"/>; 906 906 <xsl:if test="$regex"> … … 932 932 * Creates a new instance of a <xsl:value-of select="$classname"/>. 933 933 * 934 * @param str the <xsl:value-of select="$classname"/> as string representation 935 * @throws ArgumentMalformedException If the given string <code>str</code>934 * @param str the <xsl:value-of select="$classname"/> as string representation. 935 * @throws ArgumentMalformedException If the given string <code>str</code> 936 936 * violates the restriction of this type. 937 * <xsl:value-of select="$classname"/>.938 937 */ 939 938 private <xsl:value-of select="$classname"/> (final String str) … … 976 975 * @param str The str representation of the <xsl:value-of select="$classname"/> to be returned. 977 976 * @return The <xsl:value-of select="$classname"/> object represented by this str. 978 * @throws ArgumentMalformedException If the given string <code>str</code>977 * @throws ArgumentMalformedException If the given string <code>str</code> 979 978 * violates the restriction of this type. 980 * <xsl:value-of select="$classname"/>.981 979 */ 982 980 public static <xsl:value-of select="$classname"/> fromString (String str) … … 1040 1038 extends org.jcoderz.commons.util.StringUserTypeBase 1041 1039 { 1042 /** 1043 * Null or Empty constant 1044 */ 1040 /** <xsl:choose> 1041 <xsl:when 1042 test="$min-length = 0">Holds the empty string representation of the type.</xsl:when> 1043 <xsl:otherwise>Holds null as empty representation of this type.</xsl:otherwise> 1044 </xsl:choose> */ 1045 1045 private static final <xsl:value-of select="$type-classname"/> EMPTY_OR_NULL 1046 1046 = <xsl:choose><xsl:when test="$min-length = 0"> … … 1050 1050 1051 1051 /** 1052 * {@inheritDoc} 1052 * Creates a <xsl:value-of select="$type-classname"/> from its String 1053 * database representation. 1054 * @param value a string holding the database representation of the 1055 * <xsl:value-of select="$type-classname"/>. 1056 * @return a <xsl:value-of select="$type-classname"/> representing the 1057 * given string. 1058 * @see <xsl:value-of select="$type-classname"/>#fromString(String) 1053 1059 */ 1054 1060 public Object fromString(String value) … … 1057 1063 } 1058 1064 1059 /** 1060 * {@inheritDoc} 1061 */ 1065 /** <xsl:choose> 1066 <xsl:when 1067 test="$min-length = 0">@return the empty string as null representation of the type.</xsl:when> 1068 <xsl:otherwise>@return <code>null</code> as null representation of the type.</xsl:otherwise> 1069 </xsl:choose> */ 1062 1070 public Object getEmptyOrNull() 1063 1071 { … … 1066 1074 1067 1075 /** 1068 * {@inheritDoc} 1076 * @return <xsl:value-of select="$type-classname"/>.class as the supported 1077 * class of this user type. 1069 1078 */ 1070 1079 public Class returnedClass() … … 1119 1128 { 1120 1129 /** 1121 * The name of this type.1130 * <xsl:value-of select="$classname"/> - the name of this type as string constant. 1122 1131 */ 1123 1132 public static final String TYPE_NAME = "<xsl:value-of select="$classname"/>"; 1124 1133 1125 1134 /** 1126 * The minimum value of a <xsl:value-of select="$classname"/> .1135 * The minimum value of a <xsl:value-of select="$classname"/> (<xsl:value-of select="$min-value"/>). 1127 1136 */ 1128 1137 public static final long MIN_VALUE = <xsl:value-of select="$min-value"/>; 1129 1138 1130 1139 /** 1131 * The maximum value of a <xsl:value-of select="$classname"/> .1140 * The maximum value of a <xsl:value-of select="$classname"/> (<xsl:value-of select="$max-value"/>). 1132 1141 */ 1133 1142 public static final long MAX_VALUE = <xsl:value-of select="$max-value"/>; … … 1156 1165 * 1157 1166 * @param id the <xsl:value-of select="$classname"/> as long representation 1158 * @throws ArgumentMalformedException If the given long <code>id</code>1167 * @throws ArgumentMalformedException If the given long <code>id</code> 1159 1168 * violates the restriction of the type 1160 1169 * <xsl:value-of select="$classname"/>. 1161 1170 * @throws ArgumentMinValueViolationException If the value of the given 1162 * long <code>id</code> is below <code>MIN_VALUE</code>.1171 * long <code>id</code> is below {@link #MIN_VALUE}. 1163 1172 * @throws ArgumentMaxValueViolationException If the value of the given 1164 * long <code>id</code> is above <code>MAX_VALUE</code>.1173 * long <code>id</code> is above {@link #MAX_VALUE}. 1165 1174 */ 1166 1175 private <xsl:value-of select="$classname"/> (long id) … … 1185 1194 * @param id the long representation of the <xsl:value-of select="$classname"/> 1186 1195 * @return the <xsl:value-of select="$classname"/> object represented by the given long 1187 * @throws ArgumentMalformedException If the given long <code>id</code>1196 * @throws ArgumentMalformedException If the given long <code>id</code> 1188 1197 * violates the restriction of the type 1189 1198 * <xsl:value-of select="$classname"/>. 1190 1199 * @throws ArgumentMinValueViolationException If the value of the given 1191 * long <code>id</code> is below <code>MIN_VALUE</code>.1200 * long <code>id</code> is below {@link #MIN_VALUE}. 1192 1201 * @throws ArgumentMaxValueViolationException If the value of the given 1193 * long <code>id</code> is above <code>MAX_VALUE</code>.1202 * long <code>id</code> is above {@link #MAX_VALUE}. 1194 1203 */ 1195 1204 public static <xsl:value-of select="$classname"/> fromLong (long id) … … 1203 1212 * @param s the string representation of the <xsl:value-of select="$classname"/> 1204 1213 * @return the <xsl:value-of select="$classname"/> object represented by the given string 1205 * @throws ArgumentMalformedException If the given string <code>s</code>1214 * @throws ArgumentMalformedException If the given string <code>s</code> 1206 1215 * violates the restriction of the type 1207 1216 * <xsl:value-of select="$classname"/>. 1208 * @throws ArgumentMinValueViolationException If the longvalue of the given1209 * string <code>s</code> is below <code>MIN_VALUE</code>.1210 * @throws ArgumentMaxValueViolationException If the longvalue of the given1211 * string <code>s</code> is above <code>MAX_VALUE</code>.1217 * @throws ArgumentMinValueViolationException If the value of the given 1218 * long <code>id</code> is below {@link #MIN_VALUE}. 1219 * @throws ArgumentMaxValueViolationException If the value of the given 1220 * long <code>id</code> is above {@link #MAX_VALUE}. 1212 1221 */ 1213 1222 public static <xsl:value-of select="$classname"/> fromString (String s) … … 1231 1240 * @param id the Long representation of the <xsl:value-of select="$classname"/> 1232 1241 * @return the <xsl:value-of select="$classname"/> object represented by the given Long 1233 * @throws ArgumentMalformedException If the given Long <code>id</code>1242 * @throws ArgumentMalformedException If the given Long <code>id</code> 1234 1243 * is null or violates the restriction of the type 1235 1244 * <xsl:value-of select="$classname"/>. 1236 1245 * @throws ArgumentMinValueViolationException If the value of the given 1237 * long <code>id</code> is below <code>MIN_VALUE</code>.1246 * long <code>id</code> is below {@link #MIN_VALUE}. 1238 1247 * @throws ArgumentMaxValueViolationException If the value of the given 1239 * long <code>id</code> is above <code>MAX_VALUE</code>.1248 * long <code>id</code> is above {@link #MAX_VALUE}. 1240 1249 */ 1241 1250 public static <xsl:value-of select="$classname"/> fromLong (Long id) … … 1322 1331 { 1323 1332 /** 1324 * {@inheritDoc} 1333 * Creates a <xsl:value-of select="$type-classname"/> from its numeric 1334 * int database representation. 1335 * @param value a int holding the database representation of the 1336 * <xsl:value-of select="$type-classname"/>. 1337 * @return a <xsl:value-of select="$type-classname"/> representing the 1338 * given int. 1339 * @see <xsl:value-of select="$type-classname"/>#fromInt(int) 1325 1340 */ 1326 1341 public Object fromInt(int value) … … 1330 1345 1331 1346 /** 1332 * {@inheritDoc} 1347 * Converts the <xsl:value-of select="$type-classname"/> to its numeric 1348 * int database representation. 1349 * @param value the <xsl:value-of select="$type-classname"/> to be 1350 * converted. 1351 * @return a int representing the 1352 * given <xsl:value-of select="$type-classname"/>. 1353 * @see <xsl:value-of select="$type-classname"/>#toInt() 1333 1354 */ 1334 1355 public int toInt(Object value) … … 1338 1359 1339 1360 /** 1340 * {@inheritDoc} 1361 * @return <xsl:value-of select="$type-classname"/>.class as the supported 1362 * class of this user type. 1341 1363 */ 1342 1364 public Class returnedClass() … … 1366 1388 { 1367 1389 /** 1368 * {@inheritDoc} 1390 * Creates a <xsl:value-of select="$type-classname"/> from its numeric 1391 * long database representation. 1392 * @param value a long holding the database representation of the 1393 * <xsl:value-of select="$type-classname"/>. 1394 * @return a <xsl:value-of select="$type-classname"/> representing the 1395 * given long. 1396 * @see <xsl:value-of select="$type-classname"/>#fromLong(long) 1369 1397 */ 1370 1398 public Object fromLong(long value) … … 1374 1402 1375 1403 /** 1376 * {@inheritDoc} 1404 * Converts the <xsl:value-of select="$type-classname"/> to its numeric 1405 * long database representation. 1406 * @param value the <xsl:value-of select="$type-classname"/> to be 1407 * converted. 1408 * @return a long representing the 1409 * given <xsl:value-of select="$type-classname"/>. 1410 * @see <xsl:value-of select="$type-classname"/>#toLong() 1377 1411 */ 1378 1412 public long toLong(Object value) … … 1382 1416 1383 1417 /** 1384 * {@inheritDoc} 1418 * @return <xsl:value-of select="$type-classname"/>.class as the supported 1419 * class of this user type. 1385 1420 */ 1386 1421 public Class returnedClass() … … 1460 1495 * 1461 1496 * @param str the <xsl:value-of select="$classname"/> as string representation 1462 * @throws ArgumentMalformedException If the given string <code>str</code>1497 * @throws ArgumentMalformedException If the given string <code>str</code> 1463 1498 * does not conform to the Simpay Scheme representation of the 1464 1499 * <xsl:value-of select="$classname"/>. … … 1484 1519 * @param str The str representation of the <xsl:value-of select="$classname"/> to be returned. 1485 1520 * @return The <xsl:value-of select="$classname"/> object represented by this str. 1486 * @throws ArgumentMalformedException If the given string <code>s</code>1521 * @throws ArgumentMalformedException If the given string <code>s</code> 1487 1522 * does not conform to the Simpay Interface representation of 1488 1523 * <xsl:value-of select="$classname"/>. … … 1625 1660 * Fix point numeric to represent <xsl:value-of select="$classname"/>. 1626 1661 * 1627 * Permitted values range from <xsl:value-of select="$MIN_VALUE"/> to1662 * <p>Permitted values range from <xsl:value-of select="$MIN_VALUE"/> to 1628 1663 * <xsl:value-of select="$MAX_VALUE"/>. It the number of decimal 1629 1664 * digits supported is <xsl:value-of select="$fraction-digits"/> and 1630 * the total number of digits is <xsl:value-of select="$total-digits"/> 1665 * the total number of digits is <xsl:value-of select="$total-digits"/></p> 1631 1666 * 1632 1667 * Instances of this class are immutable. … … 1639 1674 { 1640 1675 /** 1641 * The name of this type.1676 * <xsl:value-of select="$classname"/> - the name of this type as String constant. 1642 1677 */ 1643 1678 public static final String TYPE_NAME = "<xsl:value-of select="$classname"/>"; 1644 1679 1645 /** 1646 * The name of this type. 1647 */ 1680 /** The preffered database representation of this type. */ 1648 1681 public static final String PREFERED_DATABASE_TYPE 1649 1682 = "NUMBER(<xsl:value-of select="$total-digits"/>,<xsl:value-of select="$fraction-digits"/>)"; 1650 1683 1651 /** The minimal unscaled value of <xsl:value-of select="$classname"/> . */1684 /** The minimal unscaled value of <xsl:value-of select="$classname"/> ({@value}). */ 1652 1685 public static final <xsl:value-of select="$backing-type"/> MIN_VALUE_UNSCALED 1653 1686 = <xsl:call-template name="power10precise"> … … 1656 1689 </xsl:call-template><xsl:value-of select="$backing-char"/>; 1657 1690 1658 /** The maximal value of <xsl:value-of select="$classname"/> . */1691 /** The maximal value of <xsl:value-of select="$classname"/> ({@value}). */ 1659 1692 public static final <xsl:value-of select="$backing-type"/> MAX_VALUE_UNSCALED 1660 1693 = <xsl:call-template name="power10precise"> … … 1663 1696 </xsl:call-template><xsl:value-of select="$backing-char"/>; 1664 1697 1665 /** The number of fraction digits . */1698 /** The number of fraction digits (<xsl:value-of select="$fraction-digits"/>). */ 1666 1699 public static final int FRACTION_DIGITS 1667 1700 = <xsl:value-of select="$fraction-digits"/>; 1668 1701 1669 /** The number of fraction digits . */1702 /** The number of fraction digits (<xsl:value-of select="$fraction-digits"/>). */ 1670 1703 public static final int SCALE 1671 1704 = FRACTION_DIGITS; 1672 1705 1673 /** The number of fraction digits. */1706 /** The scale (<xsl:value-of select="$DECIMAL_SCALE"/>). */ 1674 1707 public static final <xsl:value-of select="$backing-type"/> DECIMAL_SCALE 1675 1708 = <xsl:value-of select="$DECIMAL_SCALE"/>; 1676 1709 1677 /** The minimal scaled value of <xsl:value-of select="$classname"/> . */1710 /** The minimal scaled value of <xsl:value-of select="$classname"/> ({@value}). */ 1678 1711 public static final <xsl:value-of select="$backing-type"/> MIN_VALUE_SCALED 1679 1712 = MIN_VALUE_UNSCALED / DECIMAL_SCALE; 1680 1713 1681 /** The maximal value of <xsl:value-of select="$classname"/>. */1714 /** The maximal scaled value of <xsl:value-of select="$classname"/> ({@value}). */ 1682 1715 public static final <xsl:value-of select="$backing-type"/> MAX_VALUE_SCALED 1683 1716 = MAX_VALUE_UNSCALED / DECIMAL_SCALE; 1684 1717 1685 /** The number of fraction digits as integer . */1718 /** The number of fraction digits as integer (<xsl:value-of select="$fraction-digits"/>). */ 1686 1719 public static final Integer FRACTION_DIGITS_AS_INTEGER 1687 1720 = new Integer(FRACTION_DIGITS); 1688 1721 1689 /** The maximum number of total digits. */1722 /** The maximum number of digits (<xsl:value-of select="$total-digits"/>). */ 1690 1723 public static final int TOTAL_DIGITS 1691 1724 = <xsl:value-of select="$total-digits"/>; 1692 1725 1693 /** The number of fraction digits as integer. */1726 /** The maximum number of digits as Integer (<xsl:value-of select="$total-digits"/>). */ 1694 1727 public static final Integer TOTAL_DIGITS_AS_INTEGER 1695 1728 = new Integer(TOTAL_DIGITS); 1696 1729 1697 /** The minimal value of <xsl:value-of select="$classname"/> . */1730 /** The minimal value of <xsl:value-of select="$classname"/> (<xsl:value-of select="$MIN_VALUE"/>). */ 1698 1731 public static final <xsl:value-of select="$classname"/> MIN_VALUE 1699 1732 = new <xsl:value-of select="$classname"/>(MIN_VALUE_UNSCALED); 1700 1733 1701 /** The maximal value of <xsl:value-of select="$classname"/> . */1734 /** The maximal value of <xsl:value-of select="$classname"/> (<xsl:value-of select="$MAX_VALUE"/>). */ 1702 1735 public static final <xsl:value-of select="$classname"/> MAX_VALUE 1703 1736 = new <xsl:value-of select="$classname"/>(MAX_VALUE_UNSCALED); … … 1953 1986 import java.math.BigDecimal; 1954 1987 1955 1956 1988 /** 1957 1989 * Hibernate user type for the <xsl:value-of select="$type-classname"/>. … … 1963 1995 { 1964 1996 /** 1965 * {@inheritDoc} 1997 * Creates a <xsl:value-of select="$type-classname"/> from its numeric 1998 * BigDecimal database representation. 1999 * @param value a BigDecimal holding the database representation of the 2000 * <xsl:value-of select="$type-classname"/>. 2001 * @return a <xsl:value-of select="$type-classname"/> representing the 2002 * given BigDecimal. 2003 * @see <xsl:value-of select="$type-classname"/>#valueOf(BigDecimal) 1966 2004 */ 1967 2005 public Object fromBigDecimal(BigDecimal value) … … 1971 2009 1972 2010 /** 1973 * {@inheritDoc} 2011 * Converts the <xsl:value-of select="$type-classname"/> to its numeric 2012 * BigDecimal database representation. 2013 * @param value the <xsl:value-of select="$type-classname"/> to be 2014 * converted. 2015 * @return a BigDecimal representing the 2016 * given <xsl:value-of select="$type-classname"/>. 2017 * @see <xsl:value-of select="$type-classname"/>#toBigDecimal() 1974 2018 */ 1975 2019 public BigDecimal toBigDecimal(Object value) … … 1979 2023 1980 2024 /** 1981 * {@inheritDoc}2025 * @return <xsl:value-of select="$type-classname"/>.class as the supported class of this user type. 1982 2026 */ 1983 2027 public Class returnedClass()
