private boolean parseCommands(FtpBindingDefinition bd, XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { while (true) { switch (reader.nextTag()) { case XMLStreamConstants.END_ELEMENT: if ("commands".equals(reader.getName().getLocalPart())) { return true; } break; case XMLStreamConstants.START_ELEMENT: Location location = reader.getLocation(); if ("command".equals(reader.getName().getLocalPart())) { reader.next(); bd.addSTORCommand(reader.getText()); } else { UnrecognizedElement error = new UnrecognizedElement(reader, location, bd); context.addError(error); return false; } } } }
private boolean parseCommands(FtpBindingDefinition bd, XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { while (true) { switch (reader.nextTag()) { case XMLStreamConstants.END_ELEMENT: if ("commands".equals(reader.getName().getLocalPart())) { return true; } break; case XMLStreamConstants.START_ELEMENT: Location location = reader.getLocation(); if ("command".equals(reader.getName().getLocalPart())) { reader.next(); bd.addSTORCommand(reader.getText()); } else { UnrecognizedElement error = new UnrecognizedElement(reader, location, bd); context.addError(error); return false; } } } }
UnrecognizedElement error = new UnrecognizedElement(reader, reader.getLocation(), type); context.addError(error);
UnrecognizedElement error = new UnrecognizedElement(reader, reader.getLocation(), type); context.addError(error);
UnrecognizedElement error = new UnrecognizedElement(reader, reader.getLocation(), type); context.addError(error);
private void handleExtensionElement(Composite type, XMLStreamReader reader, IntrospectionContext childContext) throws XMLStreamException { // Extension element - for now try to load and see if we can handle it ModelObject modelObject; try { modelObject = registry.load(reader, ModelObject.class, childContext); // TODO when the loader registry is replaced this try..catch must be replaced with a check for a loader and an // UnrecognizedElement added to the context if none is found } catch (UnrecognizedElementException e) { UnrecognizedElement failure = new UnrecognizedElement(reader); childContext.addError(failure); return; } if (modelObject instanceof Property) { type.add((Property) modelObject); } else if (modelObject instanceof CompositeService) { type.add((CompositeService) modelObject); } else if (modelObject instanceof CompositeReference) { type.add((CompositeReference) modelObject); } else if (modelObject instanceof ComponentDefinition) { type.add((ComponentDefinition<?>) modelObject); } else if (type == null) { // there was an error loading the element, ingore it as the errors will have been reported } else { childContext.addError(new UnrecognizedElement(reader)); } }
UnrecognizedElement failure = new UnrecognizedElement(reader); context.addError(failure); continue; context.addError(new UnrecognizedElement(reader)); continue;
type = registry.load(reader, ModelObject.class, context); } catch (UnrecognizedElementException e) { UnrecognizedElement failure = new UnrecognizedElement(reader); context.addError(failure); continue; context.addError(new UnrecognizedElement(reader)); continue;
UnrecognizedElement failure = new UnrecognizedElement(reader); context.addError(failure); continue; context.addError(new UnrecognizedElement(reader)); continue;
service = registry.load(reader, ServiceDefinition.class, introspectionContext); } catch (UnrecognizedElementException e) { UnrecognizedElement failure = new UnrecognizedElement(reader); introspectionContext.addError(failure); continue; reference = registry.load(reader, ReferenceDefinition.class, introspectionContext); } catch (UnrecognizedElementException e) { UnrecognizedElement failure = new UnrecognizedElement(reader); introspectionContext.addError(failure); continue; modelObject = registry.load(reader, ModelObject.class, introspectionContext); } catch (UnrecognizedElementException e) { UnrecognizedElement failure = new UnrecognizedElement(reader); introspectionContext.addError(failure); continue; introspectionContext.addError(new UnrecognizedElement(reader)); continue;
} else { context.addError(new UnrecognizedElement(reader)); LoaderUtil.skipToEndElement(reader); UnrecognizedElement failure = new UnrecognizedElement(reader); context.addError(failure); return null;
type = registry.load(reader, ModelObject.class, context); } catch (UnrecognizedElementException e) { UnrecognizedElement failure = new UnrecognizedElement(reader); context.addError(failure); continue; context.addError(new UnrecognizedElement(reader)); continue;
UnrecognizedElement failure = new UnrecognizedElement(reader); context.addError(failure); return type;