Package org.sylfra.idea.plugins.xstructure.resolution

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


    {
      xpathXMapping.setMatchPattern(Pattern.compile(xMapping.getMatchString()));
    }
    catch (Exception e)
    {
      throw new XMappingException("Failed to compile regexp : " + xMapping.getMatchString());
    }
  }
View Full Code Here


    {
      xPath = new PsiXPath((XmlFile) xmlTag.getContainingFile(), mappingExp.getRawExp());
    }
    catch (JaxenException e)
    {
      throw new XMappingException("Error while parsing resolution expression : <" +
        mappingExp + ">", e);
    }

    try
    {
      return xPath.stringValueOf(xmlTag);
    }
    catch (JaxenException e)
    {
      throw new XMappingException("Error while evaluating value. Mapping expression : <"
        + mappingExp + ">. Xml content : <" + xmlTag.getText() + ">", e);
    }
  }
View Full Code Here

    {
      pattern = Pattern.compile(xMapping.getMatchString());
    }
    catch (Exception e)
    {
      throw new XMappingException("Failed to compile regexp : " + xMapping.getMatchString());
    }
    regexpXMapping.setMatchPattern(pattern);
  }
View Full Code Here

    int startNode = mappingExp.indexOf('/');
    int startAtt = mappingExp.indexOf('@');

    if ((startAtt > -1) && (startAtt < startNode))
    {
      throw new XMappingException("Bad expression, attribute may only be declared on last node : "
        + mappingExp);
    }

    // Related to this tag
    // Text or attribute ?
    if (startNode == -1)
    {
      if (startAtt == 0)
      {
        mappingExp = mappingExp.substring(1);
        XmlAttribute attribute = xmlTag.getAttribute(mappingExp);
        if (attribute == null)
        {
          return "";
        }

        return attribute.getValue();
      }

      if (startAtt > 0)
      {
        throw new XMappingException("Bad expression, attribute should be declared as @att : "
          + mappingExp);
      }
    }

    // This tag text ?
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.xstructure.resolution.XMappingException

Copyright © 2018 www.massapicom. 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.