/** * Populate annotations of a {@link MutableAnnotated} from an * {@link Element} containing a child 'annotations'. If the annotations * element is not present this method does nothing. * * @see #injectAnnotations(Element, Annotated) * @param parent * Element from where to find the 'annotations' child * @param annotated * {@link MutableAnnotated} to be annotated */ public static void populateAnnotationsFromParent(Element parent, Annotated<?> annotated) { Element annotationsElement = parent.getChild(ANNOTATIONS); if (annotationsElement != null) { annotateObject(annotationsElement, annotated); } }
/** * Make a JDOM <layer> {@link Element} serialising the given * {@link DispatchLayer}. * * @param layer * layer to serialise * @return <:layer>: {@link Element} describing the * {@link DispatchLayer} */ public static Element dispatchLayerAsXML(DispatchLayer<?> layer) throws JDOMException, IOException { Element layerElem = new Element(LAYER); ClassLoader cl = layer.getClass().getClassLoader(); if (cl instanceof LocalArtifactClassLoader) { layerElem.addContent(ravenElement((LocalArtifactClassLoader) cl)); } Element classNameElement = new Element(CLASS); classNameElement.setText(layer.getClass().getName()); layerElem.addContent(classNameElement); // Get element for configuration Object o = layer.getConfiguration(); Element configElement = beanAsElement(o); layerElem.addContent(configElement); return layerElem; }
if (ravenElement != null) { try { cl = getRavenLoader(ravenElement); } catch (Exception ex) { System.out.println("Exception loading raven classloader " Object configObject = createBean(configElement, cl); layer.configure(configObject);
Tools.populateAnnotationsFromParent(e, this); .parseInt(portElement.getAttributeValue("depth"))); Tools.populateAnnotationsFromParent(portElement, pipi); inputPorts.add(pipi); Integer.parseInt(portElement.getAttributeValue("grain"))); Tools.populateAnnotationsFromParent(portElement, popi); outputPorts.add(popi); for (Element activityElement : (List<Element>) e.getChild("activities") .getChildren("activitycontainer")) { Activity sac = Tools.buildActivity(activityElement .getChild("activity")); Tools.populateAnnotationsFromParent(activityElement, sac); activityList.add(sac);
/** * Insert the element produce by {@link #getAnnotationsElement(Annotated)} * into the specified {@link Element}. If the annotation set is empty this * does nothing - this is to prevent copy and paste code of the style 'if * there are annotations add...' * * @param element * {@link Element} where to inject annotations * @param annotated * {@link Annotated} from where to find annotations */ public static void injectAnnotations(Element element, Annotated<?> annotated) { if (!annotated.getAnnotations().isEmpty()) { element.addContent(getAnnotationsElement(annotated)); } }
name = Tools.uniqueProcessorName(name, dataflow);
/** * Make a JDOM <layer> {@link Element} serialising the given * {@link DispatchLayer}. * * @param layer * layer to serialise * @return <:layer>: {@link Element} describing the * {@link DispatchLayer} */ @Deprecated public static Element dispatchLayerAsXML(DispatchLayer<?> layer) throws JDOMException, IOException { Element layerElem = new Element(LAYER); // ClassLoader cl = layer.getClass().getClassLoader(); // if (cl instanceof LocalArtifactClassLoader) { // layerElem.addContent(ravenElement((LocalArtifactClassLoader) cl)); // } Element classNameElement = new Element(CLASS); classNameElement.setText(layer.getClass().getName()); layerElem.addContent(classNameElement); // Get element for configuration Object o = layer.getConfiguration(); Element configElement = beanAsElement(o); layerElem.addContent(configElement); return layerElem; }
Object configObject = createBean(configElement, cl); try { layer.configure(configObject);
Tools.injectAnnotations(e, this); Element port = new Element("port"); Tools.injectAnnotations(port, ip); Element port = new Element("port"); Tools.injectAnnotations(port, op); port.setAttribute("name", op.getName()); port.setAttribute("depth", op.getDepth() + ""); Element containerElement = new Element("activitycontainer"); Element activityElement = Tools.activityAsXML(saci); containerElement.addContent(activityElement); Tools.injectAnnotations(containerElement, saci); activitesElement.addContent(containerElement);
/** * Insert the element produce by {@link #getAnnotationsElement(Annotated)} * into the specified {@link Element}. If the annotation set is empty this * does nothing - this is to prevent copy and paste code of the style 'if * there are annotations add...' * * @param element * {@link Element} where to inject annotations * @param annotated * {@link Annotated} from where to find annotations */ @Deprecated public static void injectAnnotations(Element element, Annotated<?> annotated) { if (!annotated.getAnnotations().isEmpty()) { element.addContent(getAnnotationsElement(annotated)); } }
.uniqueProcessorName("Parse Moby Data(" + defaultName + ")", dataflow);
Element configElement = beanAsElement(o); activityElem.addContent(configElement);
Object configObject = createBean(configElement, cl); activity.configure(configObject); return activity;
/** * Make a JDOM <layer> {@link Element} serialising the given * {@link DispatchLayer}. * * @param layer * layer to serialise * @return <:layer>: {@link Element} describing the * {@link DispatchLayer} */ @Deprecated public static Element dispatchLayerAsXML(DispatchLayer<?> layer) throws JDOMException, IOException { Element layerElem = new Element(LAYER); ClassLoader cl = layer.getClass().getClassLoader(); if (cl instanceof LocalArtifactClassLoader) { layerElem.addContent(ravenElement((LocalArtifactClassLoader) cl)); } Element classNameElement = new Element(CLASS); classNameElement.setText(layer.getClass().getName()); layerElem.addContent(classNameElement); // Get element for configuration Object o = layer.getConfiguration(); Element configElement = beanAsElement(o); layerElem.addContent(configElement); return layerElem; }
if (ravenElement != null) { try { cl = getRavenLoader(ravenElement); } catch (Exception ex) { System.out.println("Exception loading raven classloader " Object configObject = createBean(configElement, cl); try { layer.configure(configObject);
/** * Insert the element produce by {@link #getAnnotationsElement(Annotated)} * into the specified {@link Element}. If the annotation set is empty this * does nothing - this is to prevent copy and paste code of the style 'if * there are annotations add...' * * @param element * {@link Element} where to inject annotations * @param annotated * {@link Annotated} from where to find annotations */ public static void injectAnnotations(Element element, Annotated<?> annotated) { if (!annotated.getAnnotations().isEmpty()) { element.addContent(getAnnotationsElement(annotated)); } }
/** * Populate annotations of a {@link MutableAnnotated} from an * {@link Element} containing a child 'annotations'. If the annotations * element is not present this method does nothing. * * @see #injectAnnotations(Element, Annotated) * @param parent * Element from where to find the 'annotations' child * @param annotated * {@link MutableAnnotated} to be annotated */ public static void populateAnnotationsFromParent(Element parent, Annotated<?> annotated) { Element annotationsElement = parent.getChild(ANNOTATIONS); if (annotationsElement != null) { annotateObject(annotationsElement, annotated); } }
.uniqueProcessorName(defaultName, dataflow);
if (cl instanceof LocalArtifactClassLoader) { activityElem .addContent(ravenElement((LocalArtifactClassLoader) cl)); Element configElement = beanAsElement(o); activityElem.addContent(configElement);
if (ravenElement != null) { try { cl = getRavenLoader(ravenElement); } catch (Exception ex) { System.out.println("Exception loading raven classloader " Object configObject = createBean(configElement, cl); activity.configure(configObject); return activity;