Skip to content

Commit 9b0ce24

Browse files
laxmi-lal-menariamilkshakeuk
authored andcommitted
Update XMLParser.cs
Make 'includeLongNameInEncodedXML' private. Make this field 'private' and encapsulate it in a 'public' property. Comments for ignoring error
1 parent 5626db3 commit 9b0ce24

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/NHapi.Base/Parser/XMLParser.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public abstract class XMLParser : ParserBase
6161

6262
private static readonly Regex NameSpaceRegex = new Regex(@$"xmlns(.*)=""{NameSpace}""", RegexOptions.Compiled);
6363
64-
/// <summary> includeLongNameInEncodedXML.</summary>
65-
public bool includeLongNameInEncodedXML = false;
64+
/// <summary> _includeLongNameInEncodedXML.</summary>
65+
private bool _includeLongNameInEncodedXML = false;
6666
6767
protected XMLParser()
6868
{
@@ -73,6 +73,12 @@ protected XMLParser(IModelClassFactory factory)
7373
{
7474
}
7575
76+
public bool IncludeLongNameInEncodedXML
77+
{
78+
get { return _includeLongNameInEncodedXML; }
79+
set { _includeLongNameInEncodedXML = value; }
80+
}
81+
7682
/// <summary>
7783
/// Gets the preferred encoding of this Parser.
7884
/// </summary>
@@ -374,7 +380,7 @@ public virtual bool Encode(ISegment segmentObject, XmlElement segmentElement, Pa
374380
continue;
375381
}
376382

377-
if (includeLongNameInEncodedXML && reps[j] is AbstractType rep)
383+
if (_includeLongNameInEncodedXML && reps[j] is AbstractType rep)
378384
{
379385
newNode.SetAttribute("LongName", rep.Description);
380386
}
@@ -874,7 +880,7 @@ private bool EncodeComposite(IComposite datatypeObject, XmlElement datatypeEleme
874880
continue;
875881
}
876882

877-
if (includeLongNameInEncodedXML && components[i] is AbstractType component)
883+
if (_includeLongNameInEncodedXML && components[i] is AbstractType component)
878884
{
879885
newNode.SetAttribute("LongName", component.Description);
880886
}

0 commit comments

Comments
 (0)