ISORecord implements MetadataRecord { @Override public String getIdentifier() { return getParsedProfileElement().getQueryableProperties().getIdentifier(); } ISORecord( XMLStreamReader xmlStream );  ISORecord( OMElement root ); @Override QName getName(); @Override boolean eval( Filter filter ); @Override String[] getAbstract(); @Override Envelope[] getBoundingBox(); @Override String[] getFormat(); @Override String getIdentifier(); @Override Date getModified(); @Override String[] getRelation(); @Override Object[] getSpatial(); @Override String[] getTitle(); @Override String getType(); @Override String[] getSubject(); XMLStreamReader getAsXMLStream(); @Override OMElement getAsOMElement(); byte[] getAsByteArray(); @Override void serialize( XMLStreamWriter writer, ReturnableElement returnType ); @Override void serialize( XMLStreamWriter writer, String[] elementNames ); @Override DCRecord toDublinCore(); boolean isHasSecurityConstraints(); @Override String getContributor(); @Override String getPublisher(); @Override String[] getRights(); @Override String getSource(); @Override String getCreator(); @Override String getLanguage(); String getParentIdentifier(); ParsedProfileElement getParsedElement(); String getStringFromXPath( XPath xpath ); OMElement getNodeFromXPath( XPath xpath ); String[] getStringsFromXPath( XPath xpath ); @Override void update( ValueReference propName, String s ); @Override void update( ValueReference propName, OMElement newEl ); @Override void removeNode( ValueReference propName ); boolean isServiceRecord(); @Override String toString(); static String ISO_RECORD_NS; static final String SCHEMA_URL_GMD; static final String SCHEMA_URL_SRV; }
@Test public void testInstantiationFromXMLStream() throws XMLStreamException, FactoryConfigurationError { InputStream is = ISORecordTest.class.getResourceAsStream( "datasetRecord.xml" ); XMLStreamReader xmlStream = XMLInputFactory.newInstance().createXMLStreamReader( is ); ISORecord record = new ISORecord( xmlStream ); assertEquals( "5E50884F-5549-2A7A-99E3-334234A887C81", record.getIdentifier() ); }
@Test public void testInstantiationFromXMLStreamOfBrokenRecord() throws XMLStreamException, FactoryConfigurationError { InputStream is = ISORecordTest.class.getResourceAsStream( "datasetRecord_invalidDate.invalid" ); XMLStreamReader xmlStream = XMLInputFactory.newInstance().createXMLStreamReader( is ); ISORecord record = new ISORecord( xmlStream ); boolean exception = false; try { record.getIdentifier(); } catch ( Exception e ) { exception = true; } assertTrue( exception ); }