/// /// <summary> * get a span, create it if it does not exist /// * </summary> /// * <param name="String"> /// * strName name of the span element </param> /// * <param name="JDFSpanBase"> /// * ::EnumDataType nType datatype of the new span </param> /// * <returns> JDFSpanBase the JDFSpanBase </returns> /// internal virtual JDFSpanBase getCreateSpan(string strName, JDFSpanBase.EnumDataType nType) { // / note that this is the inherited version from JDFResource! JDFSpanBase e = (JDFSpanBase)this.getCreateElement_JDFResource(strName, JDFConstants.EMPTYSTRING, 0); e.setDataType(nType); return(e); }
/// /// <summary> * Append a span if it does not yet exist, else return the existing element /// * </summary> /// * <param name="String"> /// * strName name of the span element </param> /// * <param name="JDFSpanBase"> /// * .EnumDataType nType datatype of the new span </param> /// * <returns> JDFSpanBase the JDFSpanBase </returns> /// public virtual JDFSpanBase appendSpan(string strName, JDFSpanBase.EnumDataType nType) { // / note that this is the inherited version from JDFResource! JDFSpanBase e = (JDFSpanBase)appendElement(strName, JDFConstants.EMPTYSTRING); if (nType != null) { e.setDataType(nType); } return(e); }
/// /// <summary> * get a span /// * </summary> /// * <param name="String"> /// * strName name of the span element </param> /// * <returns> JDFSpanBase the JDFSpanBase </returns> /// public virtual JDFSpanBase getSpan(string strName, JDFSpanBase.EnumDataType nType) { // / note that this is the inherited version from JDFResource! JDFSpanBase e = (JDFSpanBase)getElement(strName, JDFConstants.EMPTYSTRING, 0); if (e != null && nType != null) { JDFSpanBase.EnumDataType dataType = e.getDataType(); if (!dataType.Equals(nType)) { throw new JDFException("JDFIntentResource.getSpan incompatible datatypes" + e.getAttribute(AttributeName.DATATYPE)); } } return(e); }