Java Code Examples for org.dom4j.Element.setName()

The following are Jave code examples for showing how to use setName() of the org.dom4j.Element class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: gitplex-mit   File: DatabaseMigrator.java   Source Code and License Vote up 6 votes
private void migrateIntegrationStrategy(Element integrationStrategyElement) {
	if (integrationStrategyElement != null) {
		integrationStrategyElement.setName("mergeStrategy");
		switch (integrationStrategyElement.getText()) {
		case "MERGE_ALWAYS":
			integrationStrategyElement.setText("ALWAYS_MERGE");
			break;
		case "MERGE_WITH_SQUASH":
			integrationStrategyElement.setText("SQUASH_MERGE");
			break;
		case "REBASE_SOURCE_ONTO_TARGET":
			integrationStrategyElement.setText("REBASE_MERGE");
			break;
		case "REBASE_TARGET_ONTO_SOURCE":
			integrationStrategyElement.setText("MERGE_IF_NECESSARY");
			break;
		}
	}
}
 
Example 2
Project: lams   File: AbstractType.java   Source Code and License Vote up 5 votes
protected static void replaceNode(Node container, Element value) {
	if ( container!=value ) { //not really necessary, I guess...
		Element parent = container.getParent();
		container.detach();
		value.setName( container.getName() );
		value.detach();
		parent.add(value);
	}
}