DataElement extends BaseDimensionalItemObject implements MetadataObject, ValueTypedDimensionalItemObject { public PeriodType getPeriodType() { DataSet dataSet = getDataSet(); return dataSet != null ? dataSet.getPeriodType() : null; } DataElement();  DataElement( String name ); void addDataElementGroup( DataElementGroup group ); void removeDataElementGroup( DataElementGroup group ); void updateDataElementGroups( Set<DataElementGroup> updates ); boolean removeDataSetElement( DataSetElement element ); Set<CategoryCombo> getCategoryCombos(); CategoryCombo getDataElementCategoryCombo( DataSet dataSet ); Set<CategoryOptionCombo> getCategoryOptionCombos(); List<CategoryOptionCombo> getSortedCategoryOptionCombos(); boolean isNumericType(); boolean isFileType(); DataSet getDataSet(); DataSet getApprovalDataSet(); Set<DataSet> getDataSets(); Set<CategoryOptionCombo> getDataSetCategoryOptionCombos(); PeriodType getPeriodType(); Set<PeriodType> getPeriodTypes(); boolean isApproveData(); int getOpenFuturePeriods(); Period getLatestOpenFuturePeriod(); int getFrequencyOrder(); boolean periodTypeIsValid(); boolean hasAggregationLevels(); @Override String getFormNameFallback(); @Override @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) String getDisplayFormName(); int getExpiryDays(); boolean isExpired( Period period, Date now ); boolean hasDescription(); boolean hasUrl(); @Override boolean hasOptionSet(); @Override DimensionItemType getDimensionItemType(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isOptionSetValue(); @Override @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) ValueType getValueType(); void setValueType( ValueType valueType ); @Override @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) @PropertyRange( min = 2 ) String getFormName(); @Override void setFormName( String formName ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) DataElementDomain getDomainType(); void setDomainType( DataElementDomain domainType ); @JsonProperty( value = "categoryCombo" ) @JsonSerialize( as = BaseIdentifiableObject.class ) @JacksonXmlProperty( localName = "categoryCombo", namespace = DxfNamespaces.DXF_2_0 ) CategoryCombo getCategoryCombo(); void setCategoryCombo( CategoryCombo categoryCombo ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) @Property( PropertyType.URL ) String getUrl(); void setUrl( String url ); @JsonProperty( "dataElementGroups" ) @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "dataElementGroups", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "dataElementGroup", namespace = DxfNamespaces.DXF_2_0 ) Set<DataElementGroup> getGroups(); void setGroups( Set<DataElementGroup> groups ); @JsonProperty @JacksonXmlElementWrapper( localName = "dataSetElements", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "dataSetElements", namespace = DxfNamespaces.DXF_2_0 ) Set<DataSetElement> getDataSetElements(); void setDataSetElements( Set<DataSetElement> dataSetElements ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) List<Integer> getAggregationLevels(); void setAggregationLevels( List<Integer> aggregationLevels ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isZeroIsSignificant(); void setZeroIsSignificant( boolean zeroIsSignificant ); @Override @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) OptionSet getOptionSet(); void setOptionSet( OptionSet optionSet ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) OptionSet getCommentOptionSet(); void setCommentOptionSet( OptionSet commentOptionSet ); boolean isDataInputAllowedForPeriodAndDate( Period period, Date date ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) ObjectStyle getStyle(); void setStyle( ObjectStyle style ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) String getFieldMask(); void setFieldMask( String fieldMask ); static final String[] I18N_PROPERTIES; }
@Test public void testGetPeriodType() { DataElement de = new DataElement(); DataSet dsA = new DataSet( "A", periodType ); DataSet dsB = new DataSet( "B", periodType ); DataSet dsC = new DataSet( "C", periodType ); dsA.addDataSetElement( de ); dsB.addDataSetElement( de ); dsC.addDataSetElement( de ); assertEquals( periodType, de.getPeriodType() ); }