public class ReverseComponent implements Component { @Override public void execute(Input input, Output output) throws ComponentExecutionException { String inputValue = input.getString(); StringBuilder reversedValue = new StringBuilder(inputValue).reverse(); output.setString(reversedValue.toString()); } } <components> <component> <role>com.example.ReverseComponent</role> <implementation>com.example.ReverseComponent</implementation> <configuration> <parameter> <name>param1</name> <value>value1</value> </parameter> </configuration> </component> </components> public class JsonExtension implements PlexusExtension { @Override public void registerComponents(ComponentRegistry registry) { registry.registerComponent(new JsonInputComponent()); registry.registerComponent(new JsonOutputComponent()); } } <components> <component> <role>com.example.ComponentA</role> <implementation>com.example.ComponentA</implementation> <execution-sequence>1</execution-sequence> </component> <component> <role>com.example.ComponentB</role> <implementation>com.example.ComponentB</implementation> <execution-sequence>2</execution-sequence> </component> </components>


上一篇:
下一篇:
切换中文