/** * Creates a generic element by copying an existing element. * * @param element the element to copy * @param factory the object factory to be used for creating sub objects */ public JRBaseGenericElement(JRGenericElement element, JRBaseObjectFactory factory) { super(element, factory); this.genericType = element.getGenericType(); this.evaluationTimeValue = element.getEvaluationTimeValue(); this.evaluationGroupName = element.getEvaluationGroupName(); JRGenericElementParameter[] elementParameters = element.getParameters(); this.parameters = new ArrayList<JRGenericElementParameter>(elementParameters.length); for (int i = 0; i < elementParameters.length; i++) { JRGenericElementParameter elementParameter = elementParameters[i]; JRGenericElementParameter parameter = factory.getGenericElementParameter( elementParameter); this.parameters.add(parameter); } }
@Override public void visitGenericElement(JRGenericElement element) { JRBaseGenericElement base = null; if (element != null) { base = (JRBaseGenericElement) get(element); if (base == null) { base = new JRBaseGenericElement(element, this); } } setVisitResult(base); }
@Override public void visitGenericElement(JRGenericElement element) { JRPrintElement image = GenericElementConverter.getInstance() .convert(reportConverter, element); addElement(parentFrame, image); addContour(reportConverter, parentFrame, image); }
@Override public void visitGenericElement(JRGenericElement element) { try { xmlWriter.writeGenericElement(element); } catch (IOException e) { throw new JRRuntimeException(e); } }
/** * * protected XmlNamespace getNamespace() { return JASPERREPORTS_NAMESPACE; } /** * */ public void writeGenericElement( JRGenericElement element, String elementName) { write( "JRDesignGenericElement " + elementName + " = new JRDesignGenericElement(jasperDesign);\n"); write( elementName + ".setEvaluationTime({0});\n", element.getEvaluationTimeValue(), EvaluationTimeEnum.NOW); write( elementName + ".setEvaluationGroup(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(element.getEvaluationGroupName())); writeReportElement( element, elementName); JRGenericElementType printKey = element.getGenericType(); // JRGenericElementType t = new JRGenericElementType(printKey.getNamespace(), printKey.getName()); write( "JRGenericElementType " + elementName + "Type = new JRGenericElementType(\"" + JRStringUtil.escapeJavaStringLiteral(printKey.getNamespace()) + "\", \"" + JRStringUtil.escapeJavaStringLiteral(printKey.getName()) + "\");\n"); write( elementName + ".setGenericType(" + elementName + "Type);\n"); flush();//genericElementType JRGenericElementParameter[] params = element.getParameters(); for (int i = 0; i < params.length; i++) { JRGenericElementParameter param = params[i]; String paramName = elementName + "Parameter" + i; write( "JRDesignGenericElementParameter " + paramName + " = new JRDesignGenericElementParameter();\n"); write( paramName + ".setName(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(param.getName())); write( paramName + ".setSkipWhenEmpty({0});\n", param.isSkipWhenEmpty(), false); writeExpression(param.getValueExpression(), paramName, "ValueExpression"); write( elementName + ".addParameter({0});\n", paramName); flush();//genericElementParameter } flush();//genericElement }
public void verifyElement(JRElement element) { if (element instanceof JRStaticText) { verifyStaticText((JRStaticText)element); } else if (element instanceof JRTextField) { verifyTextField((JRTextField)element); } else if (element instanceof JRImage) { verifyImage((JRImage)element); } else if (element instanceof JRSubreport) { verifySubreport((JRSubreport)element); } else if (element instanceof JRCrosstab) { verifyCrosstab((JRDesignCrosstab) element); } else if (element instanceof JRChart) { verifyChart((JRChart) element); } else if (element instanceof JRFrame) { verifyFrame((JRFrame) element); } else if (element instanceof JRComponentElement) { verifyComponentElement((JRComponentElement) element); } else if (element instanceof JRGenericElement) { verifyGenericElement((JRGenericElement) element); } }
@Override public void visitGenericElement(JRGenericElement element) { JRFillGenericElement fill = null; if (element != null) { fill = (JRFillGenericElement) get(element); if (fill == null) { fill = new JRFillGenericElement(filler, element, this); } } setVisitResult(fill); }
protected JRTemplateGenericElement(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRGenericElement element) { super(origin, defaultStyleProvider); setElement(element); setGenericType(element.getGenericType()); }
public JRFillGenericElement(JRBaseFiller filler, JRGenericElement element, JRFillObjectFactory factory) { super(filler, element, factory); this.parameters = element.getParameters(); }
public void writeGenericElement(JRGenericElement element) throws IOException { if(isNewerVersionOrEqual(JRConstants.VERSION_3_1_0)) { writer.startElement(JRXmlConstants.ELEMENT_genericElement, getNamespace()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, element.getEvaluationTimeValue(), EvaluationTimeEnum.NOW); if (element.getEvaluationGroupName() != null) { writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, element.getEvaluationGroupName()); } writeReportElement(element); writer.startElement(JRXmlConstants.ELEMENT_genericElementType); JRGenericElementType printKey = element.getGenericType(); if (printKey != null) { writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_namespace, printKey.getNamespace()); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, printKey.getName()); } writer.closeElement();//genericElementType JRGenericElementParameter[] params = element.getParameters(); for (int i = 0; i < params.length; i++) { JRGenericElementParameter param = params[i]; writer.startElement(JRXmlConstants.ELEMENT_genericElementParameter); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, param.getName()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_skipWhenNull, param.isSkipWhenEmpty(), false); JRExpression valueExpression = param.getValueExpression(); if (valueExpression != null) { writeExpression(JRXmlConstants.ELEMENT_genericElementParameter_valueExpression, valueExpression, true, Object.class.getName()); } writer.closeElement();//genericElementParameter } writer.closeElement();//genericElement } }
@Override public void visitGenericElement(JRGenericElement element) { visitor.visitGenericElement(element); }
@Override public void visitGenericElement(JRGenericElement element) { visitElement(element); }
@Override public void visitGenericElement(JRGenericElement element) { apiWriter.writeGenericElement(element, name); }
@Override public void visitGenericElement(JRGenericElement element) { // NOOP }
protected void verifyGenericElement(JRGenericElement element) { verifyReportElement(element); if (element.getEvaluationTimeValue() == EvaluationTimeEnum.GROUP) { String groupName = element.getEvaluationGroupName(); if (groupName == null) { addBrokenRule("Evaluation group not set for generic element", element); } else { if (!jasperDesign.getGroupsMap().containsKey(groupName)) { addBrokenRule("Generic element evaluation group " + groupName + " not found in report", element); } } } JRGenericElementType type = element.getGenericType(); if (type == null) { addBrokenRule("No type set for generic element", element); } else { if (type.getNamespace() == null) { addBrokenRule("No namespace set for generic element type", type); } if (type.getName() == null) { addBrokenRule("No name set for generic element type", type); } } JRGenericElementParameter[] parameters = element.getParameters(); for (int i = 0; i < parameters.length; i++) { JRGenericElementParameter parameter = parameters[i]; if (parameter.getName() == null) { addBrokenRule("No name set for generic element parameter", parameter); } } }
@Override public JRGenericElementType getGenericType() { return ((JRGenericElement) parent).getGenericType(); }
@Override public EvaluationTimeEnum getEvaluationTimeValue() { return ((JRGenericElement) parent).getEvaluationTimeValue(); }
@Override public String getEvaluationGroupName() { return ((JRGenericElement) parent).getEvaluationGroupName(); }
public void visitGenericElement(JRGenericElement arg0) { name = "Generic element"; }
public void visitGenericElement(JRGenericElement genericElement) { node = new ElementNode(jasperDesign, (JRDesignGenericElement)genericElement,doLkp); node.setIconBaseWithExtension(ICON_GENERIC_ELEMENT); }
public void visitGenericElement(JRGenericElement genericElement) { collector.collect(genericElement); }