congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
StAXAttributeProcessor
Code IndexAdd Tabnine to your IDE (free)

How to use
StAXAttributeProcessor
in
org.apache.tuscany.sca.contribution.processor

Best Java code snippets using org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor (Showing top 20 results out of 315)

origin: org.apache.tuscany.sca/tuscany-contribution

public Object read(QName attributeName, XMLStreamReader inputSource, ProcessorContext context)
  throws ContributionReadException, XMLStreamException {
  return getProcessor().read(attributeName, inputSource, context);
}
origin: org.apache.tuscany.sca/tuscany-contribution

@SuppressWarnings("unchecked")
public void write(Object model, XMLStreamWriter outputSource, ProcessorContext context)
  throws ContributionWriteException, XMLStreamException {
  getProcessor().write(model, outputSource, context);
}
origin: org.apache.tuscany.sca/tuscany-contribution

public void addArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) {
  if (artifactProcessor.getArtifactType() != null) {
    processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
  }
  if (artifactProcessor.getModelType() != null) {
    processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor);
  }
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

@SuppressWarnings("unchecked")
public void resolve(Object model, ModelResolver resolver, ProcessorContext context)
  throws ContributionResolveException {
  getProcessor().resolve(model, resolver, context);
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

@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);
    }
  }
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

@SuppressWarnings("unchecked")
public void write(Object model, XMLStreamWriter outputSource, ProcessorContext context)
  throws ContributionWriteException, XMLStreamException {
  getProcessor().write(model, outputSource, context);
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

public Object read(QName attributeName, XMLStreamReader inputSource, ProcessorContext context)
  throws ContributionReadException, XMLStreamException {
  return getProcessor().read(attributeName, inputSource, context);
}
origin: org.apache.tuscany.sca/tuscany-contribution

public void removeArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) {
  if (artifactProcessor.getArtifactType() != null) {
    processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
  }
  if (artifactProcessor.getModelType() != null) {
    processorsByModelType.remove(artifactProcessor.getModelType());
  }
}
origin: org.apache.tuscany.sca/tuscany-contribution

@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);
    }
  }
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

/**
 *
 * @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);
    }
  }
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

  return processor.read(attributeName, source, context);
return processor == null ? null : processor.read(attributeName, source, context);
origin: org.apache.tuscany.sca/tuscany-base-runtime

public void addArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) {
  if (artifactProcessor.getArtifactType() != null) {
    processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
  }
  if (artifactProcessor.getModelType() != null) {
    processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor);
  }
}
origin: org.apache.tuscany.sca/tuscany-contribution

@SuppressWarnings("unchecked")
public void resolve(Object model, ModelResolver resolver, ProcessorContext context)
  throws ContributionResolveException {
  getProcessor().resolve(model, resolver, context);
}
origin: org.apache.tuscany.sca/tuscany-contribution

@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;
  }
}
origin: org.apache.tuscany.sca/tuscany-contribution

  return processor.read(attributeName, source, context);
return processor == null ? null : processor.read(attributeName, source, context);
origin: org.apache.tuscany.sca/tuscany-base-runtime

public void removeArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) {
  if (artifactProcessor.getArtifactType() != null) {
    processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
  }
  if (artifactProcessor.getModelType() != null) {
    processorsByModelType.remove(artifactProcessor.getModelType());
  }
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

@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;
  }
}
origin: org.apache.tuscany.sca/tuscany-contribution

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) {
origin: org.apache.tuscany.sca/tuscany-contribution

/**
 *
 * @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);
    }
  }
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

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) {
org.apache.tuscany.sca.contribution.processorStAXAttributeProcessor

Javadoc

An artifact processor that can read attributes from a StAX XMLStreamReader.

Most used methods

  • read
    Reads a model from an XMLStreamReader.
  • write
    Writes a model to an XMLStreamWriter.
  • getArtifactType
    Returns the type of artifact handled by this artifact processor.
  • getModelType
  • resolve

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • getResourceAsStream (ClassLoader)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • JButton (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now