Наследование: Rhino.Ref
Пример #1
0
		internal virtual Rhino.Xmlimpl.XML MakeXmlFromString(XMLName name, string value)
		{
			try
			{
				return NewTextElementXML(this.node, name.ToQname(), value);
			}
			catch (Exception e)
			{
				throw ScriptRuntime.TypeError(e.Message);
			}
		}
Пример #2
0
		//
		//    Methods from XMLObjectImpl
		//
		internal override bool HasXMLProperty(XMLName xmlName)
		{
			return (GetPropertyList(xmlName).Length() > 0);
		}
Пример #3
0
		internal abstract bool HasOwnProperty(XMLName xmlName);
Пример #4
0
		internal abstract XMLList Child(XMLName xmlName);
Пример #5
0
		internal abstract void AddMatches(XMLList rv, XMLName name);
Пример #6
0
		/// <summary>
		/// ecmaPut(cx, id, value) calls this after resolving when id to XMLName
		/// and checking it is not Uint32 index.
		/// </summary>
		/// <remarks>
		/// ecmaPut(cx, id, value) calls this after resolving when id to XMLName
		/// and checking it is not Uint32 index.
		/// </remarks>
		internal abstract void PutXMLProperty(XMLName name, object value);
Пример #7
0
		/// <summary>
		/// ecmaHas(cx, id) calls this after resolving when id to XMLName
		/// and checking it is not Uint32 index.
		/// </summary>
		/// <remarks>
		/// ecmaHas(cx, id) calls this after resolving when id to XMLName
		/// and checking it is not Uint32 index.
		/// </remarks>
		internal abstract bool HasXMLProperty(XMLName name);
Пример #8
0
			internal static Rhino.Xmlimpl.XmlNode.Filter PROCESSING_INSTRUCTION(XMLName name)
			{
				return new _Filter_852(name);
			}
Пример #9
0
		internal override void AddMatches(XMLList rv, XMLName name)
		{
			name.AddMatches(rv, this);
		}
Пример #10
0
		internal virtual void SetAttribute(XMLName xmlName, object value)
		{
			if (!IsElement())
			{
				throw new InvalidOperationException("Can only set attributes on elements.");
			}
			//    TODO    Is this legal, but just not "supported"?  If so, support it.
			if (xmlName.Uri() == null && xmlName.LocalName().Equals("*"))
			{
				throw ScriptRuntime.TypeError("@* assignment not supported.");
			}
			this.node.SetAttribute(xmlName.ToQname(), ScriptRuntime.ToString(value));
		}
Пример #11
0
		internal override bool HasOwnProperty(XMLName xmlName)
		{
			bool hasProperty = false;
			if (IsPrototype())
			{
				string property = xmlName.LocalName();
				hasProperty = (0 != FindPrototypeId(property));
			}
			else
			{
				hasProperty = (GetPropertyList(xmlName).Length() > 0);
			}
			return hasProperty;
		}
Пример #12
0
		internal override void PutXMLProperty(XMLName xmlName, object value)
		{
			if (IsPrototype())
			{
			}
			else
			{
				//    TODO    Is this really a no-op?  Check the spec to be sure
				xmlName.SetMyValueOn(this, value);
			}
		}
Пример #13
0
		internal override void DeleteXMLProperty(XMLName name)
		{
			XMLList list = GetPropertyList(name);
			for (int i = 0; i < list.Length(); i++)
			{
				list.Item(i).node.DeleteMe();
			}
		}
Пример #14
0
		//    Used only by XML, XMLList
		internal virtual XMLList GetPropertyList(XMLName name)
		{
			return name.GetMyValueOn(this);
		}
Пример #15
0
		internal override object GetXMLProperty(XMLName xmlName)
		{
			return GetPropertyList(xmlName);
		}
Пример #16
0
		internal static Rhino.Xmlimpl.XMLName FormProperty(Rhino.Xmlimpl.XmlNode.Namespace @namespace, string localName)
		{
			if (localName != null && localName.Equals("*"))
			{
				localName = null;
			}
			Rhino.Xmlimpl.XMLName rv = new Rhino.Xmlimpl.XMLName();
			rv.qname = Rhino.Xmlimpl.XmlNode.QName.Create(@namespace, localName);
			return rv;
		}
Пример #17
0
		internal static Rhino.Xmlimpl.XMLName Create(Rhino.Xmlimpl.XmlNode.QName qname, bool attribute, bool descendants)
		{
			Rhino.Xmlimpl.XMLName rv = new Rhino.Xmlimpl.XMLName();
			rv.qname = qname;
			rv.isAttributeName = attribute;
			rv.isDescendants = descendants;
			return rv;
		}
Пример #18
0
		internal override XMLList Elements(XMLName name)
		{
			XMLList rv = NewXMLList();
			rv.SetTargets(this, name.ToQname());
			//    TODO    Should have an XMLNode.Filter implementation based on XMLName
			Rhino.Xmlimpl.XmlNode[] elements = this.node.GetMatchingChildren(Rhino.Xmlimpl.XmlNode.Filter.ELEMENT);
			for (int i = 0; i < elements.Length; i++)
			{
				if (name.Matches(ToXML(elements[i])))
				{
					rv.AddToList(ToXML(elements[i]));
				}
			}
			return rv;
		}
Пример #19
0
				public _Filter_852(XMLName name)
				{
					this.name = name;
				}
Пример #20
0
		internal override XMLList Child(XMLName xmlName)
		{
			//    TODO    Right now I think this method would allow child( "@xxx" ) to return the xxx attribute, which is wrong
			XMLList rv = NewXMLList();
			//    TODO    Should this also match processing instructions?  If so, we have to change the filter and also the XMLName
			//            class to add an acceptsProcessingInstruction() method
			Rhino.Xmlimpl.XmlNode[] elements = this.node.GetMatchingChildren(Rhino.Xmlimpl.XmlNode.Filter.ELEMENT);
			for (int i = 0; i < elements.Length; i++)
			{
				if (xmlName.MatchesElement(elements[i].GetQname()))
				{
					rv.AddToList(ToXML(elements[i]));
				}
			}
			rv.SetTargets(this, xmlName.ToQname());
			return rv;
		}
Пример #21
0
		/// <summary>
		/// ecmaGet(cx, id) calls this after resolving when id to XMLName
		/// and checking it is not Uint32 index.
		/// </summary>
		/// <remarks>
		/// ecmaGet(cx, id) calls this after resolving when id to XMLName
		/// and checking it is not Uint32 index.
		/// </remarks>
		internal abstract object GetXMLProperty(XMLName name);
Пример #22
0
		internal virtual Rhino.Xmlimpl.XML Replace(XMLName xmlName, object xml)
		{
			PutXMLProperty(xmlName, xml);
			return this;
		}
Пример #23
0
		/// <summary>
		/// ecmaDelete(cx, id) calls this after resolving when id to XMLName
		/// and checking it is not Uint32 index.
		/// </summary>
		/// <remarks>
		/// ecmaDelete(cx, id) calls this after resolving when id to XMLName
		/// and checking it is not Uint32 index.
		/// </remarks>
		internal abstract void DeleteXMLProperty(XMLName name);
Пример #24
0
		internal override XMLList ProcessingInstructions(XMLName xmlName)
		{
			XMLList rv = NewXMLList();
			this.node.AddMatchingChildren(rv, Rhino.Xmlimpl.XmlNode.Filter.PROCESSING_INSTRUCTION(xmlName));
			return rv;
		}
Пример #25
0
		private XMLList GetMatches(XMLName name)
		{
			XMLList rv = NewXMLList();
			AddMatches(rv, name);
			return rv;
		}
Пример #26
0
		private Ref XmlPrimaryReference(Context cx, XMLName xmlName, Scriptable scope)
		{
			XMLObjectImpl xmlObj;
			XMLObjectImpl firstXml = null;
			for (; ; )
			{
				// XML object can only present on scope chain as a wrapper
				// of XMLWithScope
				if (scope is XMLWithScope)
				{
					xmlObj = (XMLObjectImpl)scope.GetPrototype();
					if (xmlObj.HasXMLProperty(xmlName))
					{
						break;
					}
					if (firstXml == null)
					{
						firstXml = xmlObj;
					}
				}
				scope = scope.GetParentScope();
				if (scope == null)
				{
					xmlObj = firstXml;
					break;
				}
			}
			// xmlObj == null corresponds to undefined as the target of
			// the reference
			if (xmlObj != null)
			{
				xmlName.InitXMLObject(xmlObj);
			}
			return xmlName;
		}
Пример #27
0
		internal abstract XMLList Elements(XMLName xmlName);
Пример #28
0
		internal static Rhino.Xmlimpl.XMLName FormStar()
		{
			Rhino.Xmlimpl.XMLName rv = new Rhino.Xmlimpl.XMLName();
			rv.qname = Rhino.Xmlimpl.XmlNode.QName.Create(null, null);
			return rv;
		}
Пример #29
0
		internal abstract XMLList ProcessingInstructions(XMLName xmlName);
Пример #30
0
		private Rhino.Xmlimpl.XMLList GetPropertyList(XMLName name)
		{
			Rhino.Xmlimpl.XMLList propertyList = NewXMLList();
			Rhino.Xmlimpl.XmlNode.QName qname = null;
			if (!name.IsDescendants() && !name.IsAttributeName())
			{
				// Only set the targetProperty if this is a regular child get
				// and not a descendant or attribute get
				qname = name.ToQname();
			}
			propertyList.SetTargets(this, qname);
			for (int i = 0; i < Length(); i++)
			{
				propertyList.AddToList(GetXmlFromAnnotation(i).GetPropertyList(name));
			}
			return propertyList;
		}