/** * @param sml * the sensorML document * @return the sensorML's characteristics modeled either in SensorML root or within Member/System */ private Characteristics[] getSensorMLCharacteristics(SensorML sml) { // stub method for eventual later use Characteristics[] characteristicsArray = sml.getCharacteristicsArray(); if (characteristicsArray != null && characteristicsArray.length != 0) { return characteristicsArray; } else { Member member = sml.getMemberArray(0); AbstractComponentType absComponent = member.isSetProcess() ? (AbstractComponentType) member.getProcess() : null; if (absComponent == null) { LOGGER.warn("SensorML does not contain a process substitution."); return new Characteristics[0]; } return absComponent.getCharacteristicsArray(); } }
/** * @param sml * the sensorML document * @return the sensorML's classifications modeled either in SensorML root or within Member/System */ private Classification[] getSensorMLClassifications(SensorML sml) { // stub method for eventual later use Classification[] classificationArray = sml.getClassificationArray(); if (classificationArray != null && classificationArray.length != 0) { return classificationArray; } else { Member member = sml.getMemberArray(0); AbstractComponentType absComponent = member.isSetProcess() ? (AbstractComponentType) member.getProcess() : null; if (absComponent == null) { LOGGER.warn("SensorML does not contain a process substitution."); return new Classification[0]; } return absComponent.getClassificationArray(); } }
/** * Gets the first Identification entry of the first SensorML member. * * @param smlDoc * the sensor description document. * @return the first Identification of the first member found in the sensor description, or * <code>null</code> if not found. */ public Identification getIdentification(SensorMLDocument smlDoc) { Member[] members = smlDoc.getSensorML().getMemberArray(); if (members.length > 0) { if (members[0].isSetProcess()) { AbstractProcessType process = members[0].getProcess(); Identification[] identificationArray = process.getIdentificationArray(); if (identificationArray.length > 0) { return identificationArray[0]; } } } return null; }