public Object read(QName attributeName, XMLStreamReader inputSource, ProcessorContext context) throws ContributionReadException, XMLStreamException { return getProcessor().read(attributeName, inputSource, context); }
@SuppressWarnings("unchecked") public void write(Object model, XMLStreamWriter outputSource, ProcessorContext context) throws ContributionWriteException, XMLStreamException { getProcessor().write(model, outputSource, context); }
public void addArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) { if (artifactProcessor.getArtifactType() != null) { processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor); } if (artifactProcessor.getModelType() != null) { processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor); } }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { getProcessor().resolve(model, resolver, context); }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { // Delegate to the processor associated with the model type if (model != null) { StAXAttributeProcessor processor = processors.getProcessor(model.getClass()); if (processor != null) { processor.resolve(model, resolver, context); } } }
@SuppressWarnings("unchecked") public void write(Object model, XMLStreamWriter outputSource, ProcessorContext context) throws ContributionWriteException, XMLStreamException { getProcessor().write(model, outputSource, context); }
public Object read(QName attributeName, XMLStreamReader inputSource, ProcessorContext context) throws ContributionReadException, XMLStreamException { return getProcessor().read(attributeName, inputSource, context); }
public void removeArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) { if (artifactProcessor.getArtifactType() != null) { processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType()); } if (artifactProcessor.getModelType() != null) { processorsByModelType.remove(artifactProcessor.getModelType()); } }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { // Delegate to the processor associated with the model type if (model != null) { StAXAttributeProcessor processor = processors.getProcessor(model.getClass()); if (processor != null) { processor.resolve(model, resolver, context); } } }
/** * * @param writer * @param extensibleElement * @param extensionAttributeProcessor * @param context TODO * @param attributeModel * @throws ContributionWriteException * @throws XMLStreamException */ protected void writeExtendedAttributes(XMLStreamWriter writer, Extensible extensibleElement, StAXAttributeProcessor extensionAttributeProcessor, ProcessorContext context) throws ContributionWriteException, XMLStreamException { for (Extension extension : extensibleElement.getAttributeExtensions()) { if (extension.isAttribute()) { extensionAttributeProcessor.write(extension, writer, context); } } }
public void addArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) { if (artifactProcessor.getArtifactType() != null) { processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor); } if (artifactProcessor.getModelType() != null) { processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor); } }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { getProcessor().resolve(model, resolver, context); }
@SuppressWarnings("unchecked") public void write(Object model, XMLStreamWriter outputSource, ProcessorContext context) throws ContributionWriteException, XMLStreamException { if (model == null) { return; } // Delegate to the processor associated with the model type StAXAttributeProcessor processor = processors.getProcessor(model.getClass()); if (processor == null) { if (!Extension.class.isInstance(model)) { if (logger.isLoggable(Level.WARNING)) { logger.warning("No StAX processor is configured to handle " + model.getClass()); } warning(context.getMonitor(), "NoStaxProcessor", processors, model.getClass()); } } else { processor.write(model, outputSource, context); return; } //handle extension attributes without processors processor = (StAXAttributeProcessor<?>)processors.getProcessor(ANY_ATTRIBUTE); if (processor == null) { if (logger.isLoggable(Level.WARNING)) { logger.warning("No Default StAX processor is configured to handle " + model.getClass()); } warning(context.getMonitor(), "NoDefaultStaxProcessor", processors, model.getClass()); } else { processor.write(model, outputSource, context); return; } }
public void removeArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) { if (artifactProcessor.getArtifactType() != null) { processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType()); } if (artifactProcessor.getModelType() != null) { processorsByModelType.remove(artifactProcessor.getModelType()); } }
@SuppressWarnings("unchecked") public void write(Object model, XMLStreamWriter outputSource, ProcessorContext context) throws ContributionWriteException, XMLStreamException { if (model == null) { return; } // Delegate to the processor associated with the model type StAXAttributeProcessor processor = processors.getProcessor(model.getClass()); if (processor == null) { if (!Extension.class.isInstance(model)) { if (logger.isLoggable(Level.WARNING)) { logger.warning("No StAX processor is configured to handle " + model.getClass()); } warning(context.getMonitor(), "NoStaxProcessor", processors, model.getClass()); } } else { processor.write(model, outputSource, context); return; } //handle extension attributes without processors processor = (StAXAttributeProcessor<?>)processors.getProcessor(ANY_ATTRIBUTE); if (processor == null) { if (logger.isLoggable(Level.WARNING)) { logger.warning("No Default StAX processor is configured to handle " + model.getClass()); } warning(context.getMonitor(), "NoDefaultStaxProcessor", processors, model.getClass()); } else { processor.write(model, outputSource, context); return; } }
if (attributeName.getNamespaceURI() != null && attributeName.getNamespaceURI().length() > 0) { if (!elementName.getNamespaceURI().equals(attributeName.getNamespaceURI())) { Object attributeValue = extensionAttributeProcessor.read(attributeName, reader, context); Extension attributeExtension; if (attributeValue instanceof Extension) {
/** * * @param writer * @param extensibleElement * @param extensionAttributeProcessor * @param context TODO * @param attributeModel * @throws ContributionWriteException * @throws XMLStreamException */ protected void writeExtendedAttributes(XMLStreamWriter writer, Extensible extensibleElement, StAXAttributeProcessor extensionAttributeProcessor, ProcessorContext context) throws ContributionWriteException, XMLStreamException { for (Extension extension : extensibleElement.getAttributeExtensions()) { if (extension.isAttribute()) { extensionAttributeProcessor.write(extension, writer, context); } } }
if (attributeName.getNamespaceURI() != null && attributeName.getNamespaceURI().length() > 0) { if (!elementName.getNamespaceURI().equals(attributeName.getNamespaceURI())) { Object attributeValue = extensionAttributeProcessor.read(attributeName, reader, context); Extension attributeExtension; if (attributeValue instanceof Extension) {