列表重命名器
Renames or promotes list names or components.When promoting or renaming, if the resulting name collides with an existing attribute name, the existing attribute will be overwritten.
For the discussion below the following terms are introduced:
- 组件–这是属性名称的一部分。例如,在list{}.blat{}.foo,的re are 3 components. Two components are lists:list{}andblat{}.One component is not a list:福.
- 子组件–这是列表的一个组件。因此,在list{}.blat{}.foo,blat{}是的子组件list{}. 同样地,福是的子组件blat{}.
- 结构化列表–子组件包含多条数据的列表。结构的元素表示为福{}.aor福{}.b.
参数
The selected list and list components that will be renamed or promoted. Selecting a list will cause the table to populate with the components available for renaming.
Changing the要处理的列表会导致List Action切换到Rename.
The action to perform on the list.
- Renamemeans the components in the selected name will be renamed only. The components of the selected list will be listed in the ‘List Component Name’ column of the列出要重命名的组件table. The ‘New Name’ will default to the old one.
Promotemeans the last component of the要处理的列表will be promoted. It will no longer be a subcomponent of the list but a ‘sibling component’.
如果last component is not a list, that item will become a list at the same level as its parent list.
如果last component of theList To Process是列表,则会提示用户选择要提升的列表索引。提升列表中的特定元素时,行为将取决于列表是否结构化(即。列表{}.bar{}.a).如果it is structured, then the subcomponents will become subcomponents of the parent. If the list is unstructured (ie.List{}.bar{}.foo{}), then the list name will become a component at the same level as the parent list (ie.List{}.foo).
如果选择此选项,则列出要重命名的组件will be populated with the components of the要处理的列表直到最后一个组件。
Promote All Subcomponentsmeans that all subcomponents of the selected list will be promoted. This option is only available if none of the subcomponents are lists. Each subcomponent will become a list at the same level as the parent list.
如果选择此选项,则列出要重命名的组件will give the list of the subcomponents of the要处理的列表.
When promoting list components, the promoted components will receive the index of their parent. As a result, if the incoming list has gaps, the outgoing list will also have gaps.
Whether or not to delete the original list entry when renaming. If set toYes然后重命名将创建一个具有所需名称的新属性,并且原始条目仍将保留。如果设置为Nothen the attribute will be renamed.
When promoting a specific element in a list, ifKeep Original List是set toNo,all list elements that do not match the specified element to promote will be removed.
当用户选择要处理的列表andList Action. 对于每个组件,“New Name”列指定组件所需的名称。
To rename a component, type the desired component name in the ‘New Name’ column for that component. Then at runtime, the transformer will rename the components to the desired component names.
Examples
例1
如果要处理的列表是somelist{}传入功能包含:
somelist{0}。length = 7.3
somelist{2}.length=5
somelist{3}.height = 6
如果somelist{}是renamed toanotherName{},的result will be:
anotherName{0}.length = 7.3
anotherName{2}.length = 5
anotherName{3}.height = 6
例2
如果要处理的列表是somelist{}.listTwo{},的List Action是Promote – listTwo{1},传入功能包含:
somelist{0}。listTwo{0} = 0
somelist{0}.listTwo{1}=1
somelist{0}。listTwo {3} = 2
Then the result will be:
somelist{0}.listTwo=1
例3
如果要处理的列表是somelist{}.listTwo{},的List Action是Promote – listTwo{1}传入功能包含:
somelist{0}。listTwo{0}.length = 0
somelist{0}。listTwo{1}.length = 1
somelist{0}。listTwo{1}.height{0} = 3
somelist{0}.listTwo{3}.length=2
Then the result will be:
somelist{0}。length = 1
somelist{0}.高度{0}=3
例4
如果要处理的列表是somelist{},的List Action是Promote All Subcomponentsand incoming feature contains the following:
somelist{0}。length = 7.3
somelist{2}.length=5
somelist{3}.height = 6
The result will be:
length{0} = 7.3
长度{2}=5
height{3} = 6
Additional Resources
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, clickbeside the applicable parameter. For more information, seeTransformer Parameter Menu Options.
Transformer Categories
Search FME Knowledge Center
Search for samples and information about this transformer on theFME知识中心.