示例#1
0
 public static Property ParseAndWalkLaxToSimple(string propertyName)
 {
     try {
         return PropertyParserNoDep.ParseAndWalkLaxToSimple(propertyName, false);
     } catch (PropertyAccessException) {
         return new SimpleProperty(propertyName);
     }
 }
示例#2
0
        public static EventPropertyGetterSPI ResolveSimpleXMLPropertyGetter(
            string propertyExpression,
            BaseXMLEventType baseXMLEventType,
            string defaultNamespacePrefix,
            bool isResolvePropertiesAbsolute)
        {
            if (!baseXMLEventType.ConfigurationEventTypeXMLDOM.IsXPathPropertyExpr) {
                var prop = PropertyParser.ParseAndWalkLaxToSimple(propertyExpression);
                var getter = prop.GetterDOM;
                if (!prop.IsDynamic) {
                    getter = new DOMConvertingGetter((DOMPropertyGetter) getter, typeof(string));
                }

                return getter;
            }

            try {
                var property = PropertyParserNoDep.ParseAndWalkLaxToSimple(propertyExpression, false);
                var isDynamic = PropertyParser.IsPropertyDynamic(property);

                var xPathExpr = SimpleXMLPropertyParser.Walk(
                    property,
                    baseXMLEventType.RootElementName,
                    defaultNamespacePrefix,
                    isResolvePropertiesAbsolute);

                if (Log.IsInfoEnabled) {
                    Log.Info(
                        "Compiling XPath expression for property '" + propertyExpression + "' as '" + xPathExpr + "'");
                }

                var xPathExpression = baseXMLEventType.CreateXPath(xPathExpr);
                var xPathReturnType = isDynamic ? XPathResultType.Any : XPathResultType.String;
                return new XPathPropertyGetter(
                    baseXMLEventType,
                    propertyExpression,
                    xPathExpr,
                    xPathExpression,
                    xPathReturnType,
                    null,
                    null);
            }
            catch (XPathException e) {
                throw new EPException(
                    "Error constructing XPath expression from property name '" + propertyExpression + '\'',
                    e);
            }
        }
示例#3
0
 public static Property ParseAndWalk(
     string propertyNested,
     bool isRootedDynamic)
 {
     return PropertyParserNoDep.ParseAndWalkLaxToSimple(propertyNested, isRootedDynamic);
 }