Beispiel #1
0
        private void EncodeChild(Node node, PrintStream psout, Indentation indenter)
        {
            psout.Print(indenter + "<" + node.NodeName);
            NamedNodeMap attrs = this._node.Attributes;

            for (int i = 0; i < attrs.Length; i++)
            {
                Node attr = attrs.Item(i);
                psout.Print(" " + attr.NodeName + "=\"" + attr.NodeValue + "\" ");
            }
            psout.Print("> ");
            psout.PrintLine();
            indenter.Down();
            NodeList children = node.ChildNodes;

            for (int i = 0; i < children.Length; i++)
            {
                Node child = children.Item(i);
                if (child.NodeType == Node.ELEMENT_NODE)
                {
                    this.EncodeChild(child, psout, indenter);
                }
                else
                {
                    string txt = child.TextContent.Trim();
                    if (txt.Length > 0)
                    {
                        psout.PrintLine(indenter + txt);
                    }
                }
            }
            indenter.Up();
            psout.PrintLine(indenter + "</" + node.NodeName + ">");
        }
Beispiel #2
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.Print(indenter + "<AttributeValue DataType=\"" + this._datatype + "\"");
            if (this._anyAttributeName != null)
            {
                psout.Print(" " + this._anyAttributeName + "=\"" + this._anyAttributeValue + "\"");
            }
            psout.PrintLine(">");
            psout.PrintLine(indenter + this.DataTypeValue.Encode());
            psout.PrintLine((indenter + "</AttributeValue>"));
        }
Beispiel #3
0
        /// <summary>
        /// Returns a string representation of this message digest object.
        /// </summary>
        public override String ToString()
        {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            PrintStream           p    = new PrintStream(baos);

            p.Print(Algorithm_Renamed + " Message Digest from " + Provider_Renamed.Name + ", ");
            switch (State)
            {
            case INITIAL:
                p.Print("<initialized>");
                break;

            case IN_PROGRESS:
                p.Print("<in progress>");
                break;
            }
            p.Println();
            return(baos.ToString());
        }
Beispiel #4
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.Print(
                indenter + "<Attribute AttributeId=\"" + this._attributeId.Encode() + "\" " + "IncludeInResult=\"" +
                this._includeInResult.Encode() + "\"");
            if (this._issuer != null)
            {
                psout.Print(" Issuer=\"" + this._issuer.Encode() + "\"");
            }

            psout.PrintLine(">");
            indenter.Down();
            foreach (AttributeValue a in this._attributeValues)
            {
                a.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</Attribute>");
        }
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.Print(
                indenter + "<MissingAttributeDetail Category=\"" + this._category + "\" AttributeId=\"" +
                this._attributeId + "\" DataType=\"" + this._dataType + "\"");
            if (this._issuer == null)
            {
                psout.PrintLine(">");
            }
            else
            {
                psout.PrintLine(" Issuer=\"" + this._issuer + "\">");
            }
            indenter.Down();
            foreach (AttributeValue a in this._attributeValues)
            {
                a.Encode(output, indenter);
            }
            indenter.Up();
            psout.Print(indenter + "</MissingAttributeDetail>");
        }
Beispiel #6
0
        internal virtual void List(PrintStream @out, int indent)
        {
            int ngroupsSnapshot;

            ThreadGroup[] groupsSnapshot;
            lock (this)
            {
                for (int j = 0; j < indent; j++)
                {
                    @out.Print(" ");
                }
                @out.Println(this);
                indent += 4;
                for (int i = 0; i < Nthreads; i++)
                {
                    for (int j = 0; j < indent; j++)
                    {
                        @out.Print(" ");
                    }
                    @out.Println(Threads[i]);
                }
                ngroupsSnapshot = Ngroups;
                if (Groups != null)
                {
                    groupsSnapshot = Arrays.CopyOf(Groups, ngroupsSnapshot);
                }
                else
                {
                    groupsSnapshot = null;
                }
            }
            for (int i = 0; i < ngroupsSnapshot; i++)
            {
                groupsSnapshot[i].List(@out, indent);
            }
        }