@Override protected void writeConnectors(StringBuilder output) throws Exception { String[] connectorClasses = getConnectorClasses(); String[] connectorNames = getConnectorNames(); for (int i = 0; i < connectorNames.length; i++) { output.append( " <repositoryconnector name=\"" + connectorNames[i] + "\" class=\"" + connectorClasses[i] + "\"/>\n"); } String[] outputClasses = getOutputClasses(); String[] outputNames = getOutputNames(); for (int i = 0; i < outputNames.length; i++) { output.append( " <outputconnector name=\"" + outputNames[i] + "\" class=\"" + outputClasses[i] + "\"/>\n"); } String[] authorityClasses = getAuthorityClasses(); String[] authorityNames = getAuthorityNames(); for (int i = 0; i < authorityNames.length; i++) { output.append( " <authorityconnector name=\"" + authorityNames[i] + "\" class=\"" + authorityClasses[i] + "\"/>\n"); } }
/** Get the variable's script value */ @Override public String getScriptValue() throws ScriptException { StringBuilder sb = new StringBuilder(); sb.append("<< "); sb.append(new VariableString(configurationNode.getType()).getScriptValue()); sb.append(" : "); String valueField = configurationNode.getValue(); if (valueField == null) valueField = ""; sb.append(new VariableString(valueField).getScriptValue()); sb.append(" : "); boolean needComma = false; Iterator<String> iter = configurationNode.getAttributes(); String[] attrs = new String[configurationNode.getAttributeCount()]; int i = 0; while (iter.hasNext()) { String attrName = iter.next(); attrs[i++] = attrName; } java.util.Arrays.sort(attrs); i = 0; while (i < attrs.length) { String attrName = attrs[i++]; String value = configurationNode.getAttributeValue(attrName); if (needComma) sb.append(", "); else needComma = true; sb.append(new VariableString(attrName).getScriptValue()); sb.append("="); sb.append(new VariableString(value).getScriptValue()); } sb.append(" : "); i = 0; while (i < configurationNode.getChildCount()) { ConfigurationNode child = configurationNode.findChild(i); if (i > 0) sb.append(", "); sb.append(new VariableConfigurationNode(child).getScriptValue()); i++; } sb.append(" >>"); return sb.toString(); }