List of usage examples for org.apache.commons.digester3 Digester addSetNext
public void addSetNext(String pattern, String methodName)
From source file:eu.scape_project.planning.xml.PlanParser.java
/** * Create a rule for reading an upload entry for the given location * <code>pattern</code>, and use the <code>method</code> to set the upload * object./*from w ww . j a v a 2s . c o m*/ * * @param digester * the digester * @param pattern * the location pattern * @param method * a method name of the parent object * @param objectType * class of object to create */ private static void addCreateUpload(final Digester digester, final String pattern, final String method, final Class<?> objectType) { digester.addObjectCreate(pattern, objectType); digester.addSetProperties(pattern); if ((method != null) && (!"".equals(method))) { digester.addSetNext(pattern, method); } /* * Note: It is not possible to read element data, process it and pass it * to a function with a simple digester Rule, neither you can define a * factory to read the data of an element. * * So we have to do it the other way round: (remember: the function * added last is executed first!) */ // 1. Create a BinaryDataWrapper if a <data> element is encountered digester.addObjectCreate(pattern + "/data", BinaryDataWrapper.class); // 3. Finally call setData on the BinaryDataWrapper(!) on top with the // object next to top as argument // The BinaryDataWrapper will call setData on to object next to top with // the previously read and decoded data digester.addSetTop(pattern + "/data", "setData"); // 2. Call setFromBase64Encoded on the BinaryDataWrapper to read the // elements content digester.addCallMethod(pattern + "/data", "setFromBase64Encoded", 0); }
From source file:eu.scape_project.planning.xml.PlanParser.java
private static void addCreateScale(final Digester digester, final Class c) { String name = c.getName();/*from w ww . j a v a2 s. c o m*/ name = name.substring(name.lastIndexOf(".") + 1); name = name.substring(0, 1).toLowerCase() + name.substring(1); String pattern = "*/" + name; digester.addObjectCreate(pattern, c); digester.addSetProperties(pattern); digester.addSetNext(pattern, "setScale"); }
From source file:br.univali.celine.scorm.model.cam.ContentPackageReader20043rd.java
protected void addPresentation(Digester d) { d.addObjectCreate("*/item/presentation", Presentation.class); d.addSetNext("*/item/presentation", "setAdlNavPresentation"); }
From source file:br.univali.celine.scorm.model.cam.ContentPackageReader20043rd.java
protected void addResources(Digester d) { d.addObjectCreate("manifest/resources", Resources.class); d.addSetNext("manifest/resources", "setResources"); addResource(d);//from w w w . j a v a 2 s . co m d.addObjectCreate("manifest/resources/resource/file", File.class); d.addSetNext("manifest/resources/resource/file", "addFile"); d.addSetProperties("manifest/resources/resource/file"); d.addObjectCreate("manifest/resources/resource/dependency", Dependency.class); d.addSetNext("manifest/resources/resource/dependency", "addDependency"); d.addSetProperties("manifest/resources/resource/dependency"); }
From source file:br.univali.celine.scorm.model.cam.ContentPackageReader20043rd.java
protected void addResource(Digester d) { d.addObjectCreate("manifest/resources/resource", Resource.class); d.addSetNext("manifest/resources/resource", "addResource"); d.addSetProperties("manifest/resources/resource", "scormType", "scormType"); d.addSetProperties("manifest/resources/resource", "base", "xmlBase"); d.addSetProperties("manifest/resources/resource"); }
From source file:br.univali.celine.scorm.model.cam.ContentPackageReader20043rd.java
protected void addRootOrganization(Digester d) { d.addObjectCreate("manifest/organizations/organization", organizationClass); d.addSetNext("manifest/organizations/organization", "addOrganization"); d.addSetProperties("manifest/organizations/organization"); d.addSetProperties("manifest/organizations/organization", "objectivesGlobalToSystem", "objectivesGlobalToSystem"); }
From source file:br.univali.celine.scorm.model.cam.ContentPackageReader20043rd.java
private void addNavigationInterface(Digester d) { d.addObjectCreate("*/item/presentation/navigationInterface", NavigationInterface.class); d.addSetNext("*/item/presentation/adlnav:navigationInterface", "setNavigationInterface"); d.addCallMethod("*/item/presentation/navigationInterface/hideLMSUI", "addHideLMSUI", 0); }
From source file:br.univali.celine.scorm.model.cam.ContentPackageReader20043rd.java
protected void addImssSequencing(Digester d, String tagParent) { d.addObjectCreate(tagParent + "/sequencing", Sequencing.class); d.addSetNext(tagParent + "/sequencing", "setImsssSequencing"); addControlMode(d, tagParent);/*from ww w. j ava 2 s.c om*/ addSequencingRules(d, tagParent); addObjectives(d, tagParent); addDeliveryControls(d, tagParent); addLimitConditions(d, tagParent); addRandomizationControls(d, tagParent); addRollupRules(d, tagParent); addRollupConsiderations(d, tagParent); addConstrainedChoiceConsiderations(d, tagParent); }
From source file:br.univali.celine.scorm.model.cam.ContentPackageReader20043rd.java
protected void addControlMode(Digester d, String tagParent) { d.addObjectCreate(tagParent + "/sequencing/controlMode", ControlMode.class); d.addSetNext(tagParent + "/sequencing/controlMode", "setControlMode"); d.addSetProperties(tagParent + "/sequencing/controlMode"); }
From source file:br.univali.celine.scorm.model.cam.ContentPackageReader20043rd.java
protected void addObjectives(Digester d, String tagParent) { d.addObjectCreate(tagParent + "/sequencing/objectives", Objectives.class); d.addSetNext(tagParent + "/sequencing/objectives", "setObjectives"); addObjective(d, tagParent + "/sequencing/objectives/primaryObjective", "setPrimaryObjective"); addObjective(d, tagParent + "/sequencing/objectives/objective", "addObjective"); }