super(Csw20Factory.eINSTANCE, CSW.RecordType);
}
@Override
public List getProperties(Object object, XSDElementDeclaration element) throws Exception {
RecordType record = (RecordType) object;
List result = new ArrayList();
XSDParticle previous = null;
String previousName = null;
for (SimpleLiteral sl : record.getDCElement()) {
XSDSchema dctSchema = DCT.getInstance().getSchema();
XSDElementDeclaration declaration = dctSchema.resolveElementDeclaration(sl.getName());
if(declaration.getTypeDefinition() == null) {
XSDSchema dcSchema = DC.getInstance().getSchema();
declaration = dcSchema.resolveElementDeclaration(sl.getName());
}
if(declaration != null) {
XSDParticle particle;
if(previousName != null && sl.getName().equals(previousName)) {
particle = previous;
} else {
particle = buildParticle(declaration);
previous = particle;
previousName = sl.getName();
}
result.add(new Object[] {particle, sl});
}
}
if(record.getBoundingBox() != null && record.getBoundingBox().size() > 0) {
for (Object box : record.getBoundingBox()) {
XSDElementDeclaration bboxElement;
if(box instanceof WGS84BoundingBoxType) {
bboxElement = OWS.getInstance().getSchema().resolveElementDeclaration("WGS84BoundingBox");
} else {
bboxElement = OWS.getInstance().getSchema().resolveElementDeclaration("BoundingBox");