Examples of IXMappingResolver


Examples of org.sylfra.idea.plugins.xstructure.resolution.IXMappingResolver

  /**
   * {@inheritDoc}
   */
  public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
  {
    IXMappingResolver xMappingResolver = (IXMappingResolver) context.get("xMappingResolver");
    IXMappingSet xMappingSet = (IXMappingSet) context.get("xMappingSet");
    IXMapping xMapping = xMappingResolver.createMapping();

    xMapping.setMappingSet(xMappingSet);

    xMapping.initLabelExp(reader.getAttribute("label"));
    xMapping.initTooltipExp(reader.getAttribute("tip"));
    xMapping.setMatchString(reader.getAttribute("match"));

    String maxLength = reader.getAttribute("maxlength");
    if (maxLength != null)
    {
      xMapping.setMaxLength(Integer.parseInt(maxLength));
    }

    // Icon
    String iconPath = reader.getAttribute("icon");
    if (iconPath != null)
    {
      xMapping.setIcon(resolveIcon(iconPath));
    }

    // Skip mode
    String skipModeValue = reader.getAttribute("skip");
    xMapping.setSkipMode(XMappingFactoryXmlImpl.readSkipMode(skipModeValue));

    try
    {
      xMappingResolver.validateMapping(xMapping);
    }
    catch (XMappingException e)
    {
      // TODO show error to user
      LOGGER.warn("Invalid mapping", e);
View Full Code Here

Examples of org.sylfra.idea.plugins.xstructure.resolution.IXMappingResolver

   */
  public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
  {
    String implType = reader.getAttribute("implType");

    IXMappingResolver xMappingResolver = readXMappingResolver(implType);
    if (xMappingResolver == null)
    {
      return null;
    }

    try
    {
      xMappingResolver.checkSupported();
    }
    catch (ImplNotSupportedException e)
    {
      LOGGER.warn("Skip mapping definition file since implementation '" + implType +
        "' is not supported in your environment : " + e.getMessage());
      return null;
    }

    // Will be needed by XMappingConverter
    context.put("xMappingResolver", xMappingResolver);

    IXMappingSet xMappingSet = xMappingResolver.createMappingSet();
    xMappingSet.setName(reader.getAttribute("name"));
    xMappingSet.setFile(LocalFileSystem.getInstance().refreshAndFindFileByIoFile(srcFile));
    xMappingSet.setVersion(reader.getAttribute("version"));

    String priorityValue = reader.getAttribute("priority");
View Full Code Here

Examples of org.sylfra.idea.plugins.xstructure.resolution.IXMappingResolver

   */
  public IXMappingResolver readXMappingResolver(String implType)
  {
    XMappingResolverFactory xMappingResolverFactory = XStructurePlugin.getInstance()
      .getXMappingResolverFactory();
    IXMappingResolver xMappingResolver = xMappingResolverFactory.getMappingResolver(implType);
    if (xMappingResolver == null)
    {
      // TODO display message to user
      // TODO check if implementation is supported
      throw new ConversionException("Unkown implementation type : " + implType
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.