repoExtension = new Extension(ExtensionType.JSON, Extension.EXTENSION_NAME_REPOINIT, true); extensions.add(repoExtension); repoExtension.setJSON(textToJSON(repoinitText.toString())); } else { throw new IllegalStateException("Repoinit sections already processed");
/** * Create a copy of the Extension * @return A copy of the Extension */ public Extension copy() { Extension c = new Extension(type, name, required); switch(type) { case TEXT: c.setText(text); break; case JSON: c.setJSON(text); break; case ARTIFACTS: if (artifacts != null) { for (Artifact a : artifacts) { c.getArtifacts().add(a.copy(a.getId())); } } break; } return c; }
target.setJSON(buffer.toString()); break;
case JSON : c.setJSON(e.getJSON()); break; case TEXT : c.setText(e.getText());