congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JTable (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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