From 1e43917c254f76fb4d8d7228e63c63362b07a124 Mon Sep 17 00:00:00 2001 From: naomi black Date: Tue, 6 May 2014 19:18:29 -0700 Subject: [PATCH 1/4] docs(formatter): improvements to currency, date, filter, and formatter library --- lib/core/annotation_src.dart | 7 +++++-- lib/formatter/currency.dart | 2 +- lib/formatter/date.dart | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/core/annotation_src.dart b/lib/core/annotation_src.dart index 643339ca9..98664729a 100644 --- a/lib/core/annotation_src.dart +++ b/lib/core/annotation_src.dart @@ -547,8 +547,11 @@ abstract class DetachAware { } /** - * Use @[Formatter] annotation to register a new formatter. A formatter is a class - * with a [call] method (a callable function). + * Use the @[Formatter] class annotation to register a new formatter. + * + * A formatter is a pure function that performs a transformation on input data from an expression. + * For more on formatters in Angular, see the documentation for the + * [angular:formatter](#angular-formatter) library. * * Usage: * diff --git a/lib/formatter/currency.dart b/lib/formatter/currency.dart index b71c0fa10..a5829b304 100644 --- a/lib/formatter/currency.dart +++ b/lib/formatter/currency.dart @@ -1,7 +1,7 @@ part of angular.formatter_internal; /** - * Formats a number as a currency (for example $1,234.56). + * Formats a number as a currency (for example 1,234.56$). * * When no currency symbol is provided, '$' is used. For more on formatters, * see the [angular:formatter](#angular-formatter) library. diff --git a/lib/formatter/date.dart b/lib/formatter/date.dart index 372217f04..abdd4e766 100644 --- a/lib/formatter/date.dart +++ b/lib/formatter/date.dart @@ -23,7 +23,7 @@ part of angular.formatter_internal; * * * For more on explicit formatting of dates and date syntax, see the documentation for the - * [DartFormat class](http://api.dartlang.org/docs/releases/latest/intl/DateFormat.html). + * [DartFormat class](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/intl/intl.DateFormat). * */ @Formatter(name:'date') From 6518f3bf9602341088df7736b569a1428501925e Mon Sep 17 00:00:00 2001 From: naomi black Date: Mon, 12 May 2014 12:36:06 -0700 Subject: [PATCH 2/4] docs: edit formatter docs --- lib/formatter/json.dart | 5 +++-- lib/formatter/limit_to.dart | 32 ++++++++++++++++++++------------ lib/formatter/lowercase.dart | 2 +- lib/formatter/number.dart | 14 ++++++++------ lib/formatter/order_by.dart | 36 ++++++++++++++++++++++++++++++++---- lib/formatter/stringify.dart | 4 ++-- lib/formatter/uppercase.dart | 2 +- 7 files changed, 67 insertions(+), 28 deletions(-) diff --git a/lib/formatter/json.dart b/lib/formatter/json.dart index 8bc45666d..7799f98fb 100644 --- a/lib/formatter/json.dart +++ b/lib/formatter/json.dart @@ -1,8 +1,9 @@ part of angular.formatter_internal; /** - * Allows you to convert a JavaScript object into JSON string. This formatter is - * mostly useful for debugging. + * Converts a JavaScript object into a JSON string. + * + * This formatter is mostly useful for debugging. * * Usage: * diff --git a/lib/formatter/limit_to.dart b/lib/formatter/limit_to.dart index a38467f61..03cc90445 100644 --- a/lib/formatter/limit_to.dart +++ b/lib/formatter/limit_to.dart @@ -2,20 +2,28 @@ part of angular.formatter_internal; /** * Creates a new List or String containing only a prefix/suffix of the - * elements as specified by the `limit` parameter. + * elements. + * + * The number of elements to return is specified by the `limitTo` parameter. + * + * Usage: + * + * {{ expression | limitTo:_value_ }} * - * When operating on a List, the returned list is always a copy even when all - * the elements are being returned. * - * When the `limit` expression evaluates to a positive integer, `limit` items - * from the beginning of the List/String are returned. When `limit` evaluates - * to a negative integer, `|limit|` items from the end of the List/String are - * returned. If `|limit|` is larger than the size of the List/String, then the - * entire List/String is returned. In the case of a List, a copy of the list is - * returned. + *
{{item}}
* - * If the `limit` expression evaluates to a null or non-integer, then an empty - * list is returned. If the input is a null List/String, a null is returned. + * + * Where the input expression is a [List] or [String], and `limitTo` evaluates to: + * + * - **a positive integer**: return _value_ items from the beginning of the list or string + * expression. + * - **a negative integer**: return _value_ items from the end of the list or string expression. + * - **null or non-integer**: return an empty list or string. + * - **`|limitTo|` greater than the size of the expression**: return the entire expression. + * + * When operating on a [List], the returned list is always a copy even when all + * the elements are being returned. * * Example: * @@ -29,7 +37,7 @@ part of angular.formatter_internal; * *
  • {{i}}
  • * - * results in + * produces the following: * *
  • i
  • *
  • j
  • diff --git a/lib/formatter/lowercase.dart b/lib/formatter/lowercase.dart index 004a837f5..c00b4ace4 100644 --- a/lib/formatter/lowercase.dart +++ b/lib/formatter/lowercase.dart @@ -1,7 +1,7 @@ part of angular.formatter_internal; /** - * Converts string to lowercase. + * Converts a string to lowercase. * * Usage: * diff --git a/lib/formatter/number.dart b/lib/formatter/number.dart index 1cb2514b6..6dd39ae15 100644 --- a/lib/formatter/number.dart +++ b/lib/formatter/number.dart @@ -3,7 +3,7 @@ part of angular.formatter_internal; /** * Formats a number as text. * - * If the input is not a number an empty string is returned. + * If the input is not a number, an empty string is returned. * * * Usage: @@ -17,12 +17,14 @@ class Number { var _nfs = new Map>(); /** - * [value]: the value to format + * Format a number as text. + * + * - `value`: the value to format + * - `fractionSize`: Number of decimal places to round the number to. + * + * When fractionSize is not provided, fraction size is computed from the current locale's number + * formatting pattern. In the case of the default locale, it will be 3. * - * [fractionSize]: Number of decimal places to round the number to. If this - * is not provided then the fraction size is computed from the current - * locale's number formatting pattern. In the case of the default locale, - * it will be 3. */ call(value, [fractionSize = null]) { if (value is String) value = double.parse(value); diff --git a/lib/formatter/order_by.dart b/lib/formatter/order_by.dart index 739433d5d..25cae8b94 100644 --- a/lib/formatter/order_by.dart +++ b/lib/formatter/order_by.dart @@ -3,7 +3,32 @@ part of angular.formatter_internal; typedef dynamic _Mapper(dynamic e); /** - * Orders the provided [Iterable] by the `expression` predicate. + * Orders the the elements of an object by a predicate expression. + * + * Usage: + * + *
    + * + * + * The input must be an [Iterable] object. The expression may be specified as: + * + * - `+`: sort the elements in asending order. This is the default comparator. + * - `-`: sort the elements in descending order. + * - **a string expression**: sort on a decorated/transformed value, such as "lastName", + * or to sort non-primitives values. + * - **a custom callable expression**: an expression that will be called to transform the element + * before a sort. + * - **a list**: the list may consist of either string or callable expressions. A list expression + * indicates a list of fallback expressions to use when a comparision results in the items + * being equal. + * + * If the expression is explicitly empty(`orderBy:```), the elements are sorted in + * ascending order, using the default comparator, `+`. + * + * Last, by appending `:true`, you can set "descending order" to true, + * which has the same effect as the `-` comparator. + * + * # Examples * * Example 1: Simple array and single/empty expression. * @@ -24,7 +49,7 @@ typedef dynamic _Mapper(dynamic e); *
      * * The empty string expression, `''`, here signifies sorting in ascending order - * using the default comparator. Using `'+'` would also work as the `+` prefix + * using the default comparator. Using `'+'` would also work, as the `+` prefix * is implied. * * To sort in descending order, you would use the `'-'` prefix. @@ -44,7 +69,7 @@ typedef dynamic _Mapper(dynamic e); * * Example 2: Complex objects, single expression. * - * You may provide a more complex expression to sort non-primitives values or + * You may provide a more complex expression to sort non-primitive values or * if you want to sort on a decorated/transformed value. * * e.g. Support you have a list `users` that looks like this: @@ -135,7 +160,10 @@ class OrderBy implements Function { } /** - * expression: String/Function or Array of String/Function. + * Order a list by expression. + * + * - `expression`: String/Function or Array of String/Function. + * - `descending`: When specified, use descending order. (The default is ascending order.) */ List call(List items, var expression, [bool descending=false]) { if (items == null) { diff --git a/lib/formatter/stringify.dart b/lib/formatter/stringify.dart index 439bfc645..a1bc8ea3f 100644 --- a/lib/formatter/stringify.dart +++ b/lib/formatter/stringify.dart @@ -1,9 +1,9 @@ part of angular.formatter_internal; /** - * Allows you to convert an object to a string. + * Converts an object to a string. * - * Null object are converted to an empty string. + * Null objects are converted to an empty string. * * * Usage: diff --git a/lib/formatter/uppercase.dart b/lib/formatter/uppercase.dart index 722170d2f..f47b56b01 100644 --- a/lib/formatter/uppercase.dart +++ b/lib/formatter/uppercase.dart @@ -1,7 +1,7 @@ part of angular.formatter_internal; /** - * Converts string to uppercase. + * Converts a string to uppercase. * * Usage: * From 77668e79234de12bb0ceadc8757b70042ee70db5 Mon Sep 17 00:00:00 2001 From: naomi black Date: Mon, 12 May 2014 14:21:40 -0700 Subject: [PATCH 3/4] docs(formatter): fix "leading" in currency and edits to limit_to --- lib/formatter/currency.dart | 5 +++-- lib/formatter/limit_to.dart | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/formatter/currency.dart b/lib/formatter/currency.dart index a5829b304..bc1f641ba 100644 --- a/lib/formatter/currency.dart +++ b/lib/formatter/currency.dart @@ -1,7 +1,7 @@ part of angular.formatter_internal; /** - * Formats a number as a currency (for example 1,234.56$). + * Formats a number as a currency (for example $1,234.56). * * When no currency symbol is provided, '$' is used. For more on formatters, * see the [angular:formatter](#angular-formatter) library. @@ -22,7 +22,8 @@ class Currency implements Function { * * - `value`: the value to format as currency. * - `symbol`: the currency symbol to use. If no symbol is specified, `$` is used. - * - `leading`: places the symbol in front of the number instead of following it. + * - `leading`: when set to false, places the symbol after the number instead of before + * it. */ call(value, [symbol = r'$', leading = true]) { if (value is String) value = double.parse(value); diff --git a/lib/formatter/limit_to.dart b/lib/formatter/limit_to.dart index 03cc90445..b2071e1e3 100644 --- a/lib/formatter/limit_to.dart +++ b/lib/formatter/limit_to.dart @@ -8,19 +8,19 @@ part of angular.formatter_internal; * * Usage: * - * {{ expression | limitTo:_value_ }} + * {{ expression | limitTo:_number_ }} * * - *
      {{item}}
      + *
      {{item}}
      * * - * Where the input expression is a [List] or [String], and `limitTo` evaluates to: + * Where the input expression is a [List] or [String], and `limitTo` is: * - * - **a positive integer**: return _value_ items from the beginning of the list or string + * - **a positive integer**: return _number_ items from the beginning of the list or string * expression. - * - **a negative integer**: return _value_ items from the end of the list or string expression. - * - **null or non-integer**: return an empty list or string. + * - **a negative integer**: return _number_ items from the end of the list or string expression. * - **`|limitTo|` greater than the size of the expression**: return the entire expression. + * - **null** or all other cases: return an empty list or string. * * When operating on a [List], the returned list is always a copy even when all * the elements are being returned. From 01bcc383ab57b299f03c111d0a70aee7f9cc63cb Mon Sep 17 00:00:00 2001 From: naomi black Date: Wed, 14 May 2014 10:20:26 -0700 Subject: [PATCH 4/4] docs(formatter): fix and edit per comments on 0e0f8d6 Closes #1036 --- lib/core/annotation_src.dart | 7 +++++-- lib/formatter/arrayify.dart | 4 ++-- lib/formatter/currency.dart | 13 +++++++++--- lib/formatter/date.dart | 2 +- lib/formatter/filter.dart | 13 ++++++------ lib/formatter/json.dart | 11 +++++++--- lib/formatter/limit_to.dart | 19 +++++++----------- lib/formatter/lowercase.dart | 4 ++-- lib/formatter/module.dart | 8 +++----- lib/formatter/module_internal.dart | 6 ++++++ lib/formatter/number.dart | 6 +++--- lib/formatter/order_by.dart | 32 ++++++++++++++---------------- lib/formatter/stringify.dart | 4 ++-- lib/formatter/uppercase.dart | 4 ++-- 14 files changed, 72 insertions(+), 61 deletions(-) diff --git a/lib/core/annotation_src.dart b/lib/core/annotation_src.dart index 98664729a..88fa1f618 100644 --- a/lib/core/annotation_src.dart +++ b/lib/core/annotation_src.dart @@ -547,13 +547,16 @@ abstract class DetachAware { } /** - * Use the @[Formatter] class annotation to register a new formatter. + * Use the @[Formatter] class annotation to identify a class as a formatter. * * A formatter is a pure function that performs a transformation on input data from an expression. * For more on formatters in Angular, see the documentation for the * [angular:formatter](#angular-formatter) library. * - * Usage: + * A formatter class must have a call method with at least one parameter, which specifies the value to format. Any + * additional parameters are treated as arguments of the formatter. + * + * **Usage** * * // Declaration * @Formatter(name:'myFormatter') diff --git a/lib/formatter/arrayify.dart b/lib/formatter/arrayify.dart index e38bc1a34..f2527eee9 100644 --- a/lib/formatter/arrayify.dart +++ b/lib/formatter/arrayify.dart @@ -1,9 +1,9 @@ part of angular.formatter_internal; /** - * Given a Map, returns a list of items which have `key` and `value` property. + * Transforms a Map into an array so that the map can be used with `ng-repeat`. * - * Usage: + * Example: * *
      * {{item.key}}: {{item.value}} diff --git a/lib/formatter/currency.dart b/lib/formatter/currency.dart index bc1f641ba..ef90b7067 100644 --- a/lib/formatter/currency.dart +++ b/lib/formatter/currency.dart @@ -7,10 +7,17 @@ part of angular.formatter_internal; * see the [angular:formatter](#angular-formatter) library. * * - * Usage: + * # Usage * * {{ numeric_expression | currency[:symbol[:leading]] }} * + * # Example + * + * {{ 1234 | currency }} // output is $1,234.00 + * {{ 1234 | currency:'CAD' }} // output is CAD1,234.00 + * {{ 1234 | currency:'CAD':false }} // output is 1,234.00CAD + * + * */ @Formatter(name:'currency') class Currency implements Function { @@ -22,8 +29,8 @@ class Currency implements Function { * * - `value`: the value to format as currency. * - `symbol`: the currency symbol to use. If no symbol is specified, `$` is used. - * - `leading`: when set to false, places the symbol after the number instead of before - * it. + * - `leading`: false places the symbol after the number instead of before + * it. (By default, leading is true.) */ call(value, [symbol = r'$', leading = true]) { if (value is String) value = double.parse(value); diff --git a/lib/formatter/date.dart b/lib/formatter/date.dart index abdd4e766..d34c1c2c4 100644 --- a/lib/formatter/date.dart +++ b/lib/formatter/date.dart @@ -5,7 +5,7 @@ part of angular.formatter_internal; * * Usage: * - * {{ date_expression | date[:format] }} + * date_expression | date[:format] * * Here `format` may be specified explicitly, or by using one of the following predefined * localizable names: diff --git a/lib/formatter/filter.dart b/lib/formatter/filter.dart index e34798c4c..40ef72c14 100644 --- a/lib/formatter/filter.dart +++ b/lib/formatter/filter.dart @@ -8,15 +8,14 @@ typedef bool _Equals(a, b); * Selects a subset of items from the provided [List] and returns it as a new * [List]. * - * Usage: + * # Usage * - *
      + * filter: expression[:comparator] * - * In addition to the `expression`, which is used to select a subset from the list, - * you can also specify a `comparator` to specify how the operation is performed.  + * In addition to the expression, which is used to select a subset from the list, + * you can also specify a comparator to specify how the operation is performed.  * - * - * `expression` can be of the following types: + * The expression can be of the following types: * * - [String], [bool] and [num]:  Only items in the list that directly * match this expression, items that are Maps with any value matching this @@ -36,7 +35,7 @@ typedef bool _Equals(a, b); * `true`. * * - * `comparator` is optional and can be one of the following: + * The comparator is optional and can be one of the following: * * - `bool comparator(expected, actual)`:  The function will be called with the * object value and the predicate value to compare and should return true if diff --git a/lib/formatter/json.dart b/lib/formatter/json.dart index 7799f98fb..aa8d06a42 100644 --- a/lib/formatter/json.dart +++ b/lib/formatter/json.dart @@ -1,13 +1,18 @@ part of angular.formatter_internal; /** - * Converts a JavaScript object into a JSON string. + * Converts an object into a JSON string. * * This formatter is mostly useful for debugging. * - * Usage: + * Note that the object to convert must be directly encodable to JSON, that is, a + * number, boolean, string, null, list or a map with string keys). To convert other objects, the + * [toEncodable](http://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-convert + * .JsonCodec#id_encode) function must be used first. * - * {{ json_expression | json }} + * # Usage + * + * json_expression | json */ @Formatter(name:'json') class Json implements Function { diff --git a/lib/formatter/limit_to.dart b/lib/formatter/limit_to.dart index b2071e1e3..5dbe71372 100644 --- a/lib/formatter/limit_to.dart +++ b/lib/formatter/limit_to.dart @@ -6,13 +6,9 @@ part of angular.formatter_internal; * * The number of elements to return is specified by the `limitTo` parameter. * - * Usage: - * - * {{ expression | limitTo:_number_ }} - * - * - *
      {{item}}
      + * # Usage * + * expression | limitTo:number * * Where the input expression is a [List] or [String], and `limitTo` is: * @@ -25,15 +21,14 @@ part of angular.formatter_internal; * When operating on a [List], the returned list is always a copy even when all * the elements are being returned. * - * Example: + * # Examples * - * - `{{ 'abcdefghij' | limitTo: 4 }}` → `'abcd'` - * - `{{ 'abcdefghij' | limitTo: -4 }}` → `'ghij'` - * - `{{ 'abcdefghij' | limitTo: -100 }}` → `'abcdefghij'` + * {{ 'abcdefghij' | limitTo: 4 }} // output is 'abcd' + * {{ 'abcdefghij' | limitTo: -4 }} // output is 'ghij' + * {{ 'abcdefghij' | limitTo: -100 }} // output is 'abcdefghij' * - *
      * - * This [ng-repeat] directive: + * This `ng-repeat` directive: * *
    • {{i}}
    • * diff --git a/lib/formatter/lowercase.dart b/lib/formatter/lowercase.dart index c00b4ace4..93de5adde 100644 --- a/lib/formatter/lowercase.dart +++ b/lib/formatter/lowercase.dart @@ -3,9 +3,9 @@ part of angular.formatter_internal; /** * Converts a string to lowercase. * - * Usage: + * # Usage * - * {{ lowercase_expression | lowercase }} + * expression | lowercase */ @Formatter(name:'lowercase') class Lowercase implements Function { diff --git a/lib/formatter/module.dart b/lib/formatter/module.dart index 478c7844d..8833bb678 100644 --- a/lib/formatter/module.dart +++ b/lib/formatter/module.dart @@ -1,5 +1,4 @@ /** - * * Formatters for [angular.dart](#angular/angular), a web framework for Dart. A formatter is a * pure function that performs a transformation on input data from an expression. * @@ -13,17 +12,16 @@ * * For example: * - * {{ _some_expression_ | json }} + * {{ expression | json }} * * or, in a repeater: * - *
      - * - * + *
      */ library angular.formatter; export "package:angular/formatter/module_internal.dart" show + FormatterModule, Currency, Date, Filter, diff --git a/lib/formatter/module_internal.dart b/lib/formatter/module_internal.dart index 14a27d353..d13aa500e 100644 --- a/lib/formatter/module_internal.dart +++ b/lib/formatter/module_internal.dart @@ -19,6 +19,12 @@ part 'order_by.dart'; part 'uppercase.dart'; part 'stringify.dart'; +/** + * This module registers all the Angular formatters. + * + * When instantiating an Angular application through applicationFactory, + * FormatterModule is automatically included. + */ class FormatterModule extends Module { FormatterModule() { bind(Arrayify); diff --git a/lib/formatter/number.dart b/lib/formatter/number.dart index 6dd39ae15..4778f6d3a 100644 --- a/lib/formatter/number.dart +++ b/lib/formatter/number.dart @@ -6,9 +6,9 @@ part of angular.formatter_internal; * If the input is not a number, an empty string is returned. * * - * Usage: + * # Usage * - * {{ number_expression | number[:fractionSize] }} + * number_expression | number[:fractionSize] * */ @Formatter(name:'number') @@ -22,7 +22,7 @@ class Number { * - `value`: the value to format * - `fractionSize`: Number of decimal places to round the number to. * - * When fractionSize is not provided, fraction size is computed from the current locale's number + * When `fractionSize` is not provided, fraction size is computed from the current locale's number * formatting pattern. In the case of the default locale, it will be 3. * */ diff --git a/lib/formatter/order_by.dart b/lib/formatter/order_by.dart index 25cae8b94..ca33ad605 100644 --- a/lib/formatter/order_by.dart +++ b/lib/formatter/order_by.dart @@ -3,30 +3,28 @@ part of angular.formatter_internal; typedef dynamic _Mapper(dynamic e); /** - * Orders the the elements of an object by a predicate expression. + * Orders the the elements of a list using a predicate. * - * Usage: + * # Usage * - *
      + * expression | orderBy: predicate[:true] * + * The input to orderBy must be an [Iterable] object. The predicate may be specified as: * - * The input must be an [Iterable] object. The expression may be specified as: - * - * - `+`: sort the elements in asending order. This is the default comparator. - * - `-`: sort the elements in descending order. - * - **a string expression**: sort on a decorated/transformed value, such as "lastName", - * or to sort non-primitives values. + * - **a string**: a string containing an expression, such as "user.lastName", used to order the list. The string + * expression can be prefixed to indicate sort order: + * - `+`: sort the elements in asending order. This is the default. + * - `-`: sort the elements in descending order. * - **a custom callable expression**: an expression that will be called to transform the element - * before a sort. - * - **a list**: the list may consist of either string or callable expressions. A list expression - * indicates a list of fallback expressions to use when a comparision results in the items - * being equal. + * before a sort. + * - **a list**: the list may consist of either strings or callable expressions. A list expression + * indicates a list of fallback expressions to use when a comparision results in the items + * being equal. * - * If the expression is explicitly empty(`orderBy:```), the elements are sorted in + * If the expression is explicitly empty(`orderBy:''`), the elements are sorted in * ascending order, using the default comparator, `+`. * - * Last, by appending `:true`, you can set "descending order" to true, - * which has the same effect as the `-` comparator. + * Last, by appending `true`, you can set "descending order" to true, which has the same effect as the `-` comparator. * * # Examples * @@ -85,7 +83,7 @@ typedef dynamic _Mapper(dynamic e); * If you want to list the authors sorted by `lastName`, you would use * *
    • - * {{author.lastName}}, {{author.firstName + * {{author.lastName}}, {{author.firstName}} *
    • * * The string expression, `'lastName'`, indicates that the sort should be on the diff --git a/lib/formatter/stringify.dart b/lib/formatter/stringify.dart index a1bc8ea3f..e5ad51a95 100644 --- a/lib/formatter/stringify.dart +++ b/lib/formatter/stringify.dart @@ -6,9 +6,9 @@ part of angular.formatter_internal; * Null objects are converted to an empty string. * * - * Usage: + * # Usage: * - * {{ expression | stringify }} + * expression | stringify */ @Formatter(name:'stringify') class Stringify implements Function { diff --git a/lib/formatter/uppercase.dart b/lib/formatter/uppercase.dart index f47b56b01..694782bca 100644 --- a/lib/formatter/uppercase.dart +++ b/lib/formatter/uppercase.dart @@ -3,9 +3,9 @@ part of angular.formatter_internal; /** * Converts a string to uppercase. * - * Usage: + * # Usage: * - * {{ uppercase_expression | uppercase }} + * expression | uppercase */ @Formatter(name:'uppercase') class Uppercase implements Function {