function $AdfMarshalingService$$() {
  this.Init();
}
$goog$exportSymbol$$("AdfMarshalingService", $AdfMarshalingService$$);
$AdfObject$$.$createSubclass$($AdfMarshalingService$$);
$AdfMarshalingService$$.prototype.Init = function $$AdfMarshalingService$$$$Init$() {
  $AdfMarshalingService$$.$superclass$.Init.call(this);
  this.$_typeMap$ = {};
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMarshalingService.prototype.Init", {Init:$AdfMarshalingService$$.prototype.Init});
$AdfMarshalingService$$.prototype.$registerEncoder$ = function $$AdfMarshalingService$$$$$registerEncoder$$($encoder$$) {
  var $encoderTypeMap$$ = $encoder$$.$_typeMap$, $typeMap$$ = this.$_typeMap$, $type$$148$$;
  for ($type$$148$$ in $encoderTypeMap$$) {
    $typeMap$$[$type$$148$$] = {name:$encoderTypeMap$$[$type$$148$$], encoder:$encoder$$};
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMarshalingService.prototype.registerEncoder", {$registerEncoder$:$AdfMarshalingService$$.prototype.$registerEncoder$});
$AdfMarshalingService$$.prototype.$marshal$ = function $$AdfMarshalingService$$$$$marshal$$($parentElem$$1$$, $obj$$34$$, $objStack$$) {
  var $encoderEntry_node$$59$$ = $JSCompiler_StaticMethods__getEncoderEntryByType$$(this, $obj$$34$$.constructor);
  null == $encoderEntry_node$$59$$ && ($encoderEntry_node$$59$$ = $JSCompiler_StaticMethods__getEncoderEntryByType$$(this, Object));
  if (null == $objStack$$) {
    $objStack$$ = new $AdfMarshalingService$$.$_ObjectStack$;
  } else {
    var $JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$;
    a: {
      $JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$ = $objStack$$.stack;
      for (var $stackSize$$inline_591$$ = $JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$.length, $i$$inline_592$$ = 0;$i$$inline_592$$ < $stackSize$$inline_591$$;$i$$inline_592$$++) {
        var $stackObj$$inline_593$$ = $JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$[$i$$inline_592$$];
        if ($stackObj$$inline_593$$ === $obj$$34$$ && $obj$$34$$.constructor === $stackObj$$inline_593$$.constructor) {
          $JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$ = !0;
          break a;
        }
      }
      $JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$ = !1;
    }
    if ($JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$) {
      return null;
    }
  }
  $objStack$$.push($obj$$34$$);
  $JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$ = $encoderEntry_node$$59$$.$encoder$;
  $encoderEntry_node$$59$$ = $AdfMarshalingService$$.$_createElementNS$($parentElem$$1$$.ownerDocument, $encoderEntry_node$$59$$.name);
  $parentElem$$1$$.appendChild($encoderEntry_node$$59$$);
  $JSCompiler_inline_result$$29_encoder$$1_stack$$inline_590$$.encode($encoderEntry_node$$59$$, $obj$$34$$, $objStack$$, this);
  $objStack$$.pop($obj$$34$$);
  return $encoderEntry_node$$59$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMarshalingService.prototype.marshal", {$marshal$:$AdfMarshalingService$$.prototype.$marshal$});
$AdfMarshalingService$$.getDefault = function $$AdfMarshalingService$$$getDefault$() {
  var $service$$ = $AdfMarshalingService$$.$_defaultService$;
  $service$$ || ($service$$ = new $AdfMarshalingService$$, $service$$.$registerEncoder$(new $AdfMarshalingService$$.$_DE$), $AdfMarshalingService$$.$_defaultService$ = $service$$);
  return $service$$;
};
$goog$exportSymbol$$("AdfMarshalingService.getDefault", $AdfMarshalingService$$.getDefault);
function $JSCompiler_StaticMethods__getEncoderEntryByType$$($JSCompiler_StaticMethods__getEncoderEntryByType$self$$, $type$$149$$) {
  return $JSCompiler_StaticMethods__getEncoderEntryByType$self$$.$_typeMap$[$type$$149$$ === String ? "String" : $type$$149$$ === Boolean ? "Boolean" : $type$$149$$ === Number ? "Number" : $type$$149$$ === Array ? "Array" : $type$$149$$ === Date ? "Date" : $AdfUIComponent$$.prototype.isPrototypeOf($type$$149$$.prototype) ? "AdfUIComponent" : $AdfKeyStroke$$ === $type$$149$$ ? "AdfKeyStroke" : "Object"];
}
$AdfMarshalingService$$.$_createElementNS$ = function $$AdfMarshalingService$$$$_createElementNS$$($doc$$30$$, $name$$86$$) {
  var $agent$$42$$ = $AdfAgent$$.$AGENT$;
  return $agent$$42$$.$getPlatform$() == $AdfAgent$$.$IE_PLATFORM$ && 11 > $agent$$42$$.$getVersion$() ? $doc$$30$$.createNode(1, $name$$86$$, "http://oracle.com/richClient/comm") : $doc$$30$$.createElementNS("http://oracle.com/richClient/comm", $name$$86$$);
};
$AdfMarshalingService$$.$_ObjectStack$ = function $$AdfMarshalingService$$$$_ObjectStack$$() {
  this.stack = [];
};
$AdfMarshalingService$$.$_ObjectStack$.prototype.push = function $$AdfMarshalingService$$$$_ObjectStack$$$push$($obj$$35$$) {
  this.stack.push($obj$$35$$);
};
$AdfMarshalingService$$.$_ObjectStack$.prototype.pop = function $$AdfMarshalingService$$$$_ObjectStack$$$pop$() {
  return this.stack.pop();
};
$AdfMarshalingService$$.$_DE$ = function $$AdfMarshalingService$$$$_DE$$() {
  var $typeMap$$1$$ = {};
  $typeMap$$1$$.Number = $AdfMarshalingService$$.$_DE$.$NUMBER$;
  $typeMap$$1$$.Boolean = $AdfMarshalingService$$.$_DE$.$BOOLEAN$;
  $typeMap$$1$$.String = $AdfMarshalingService$$.$_DE$.$STRING$;
  $typeMap$$1$$.Date = $AdfMarshalingService$$.$_DE$.$DATE$;
  $typeMap$$1$$.Array = $AdfMarshalingService$$.$_DE$.$ARRAY$;
  $typeMap$$1$$.Object = $AdfMarshalingService$$.$_DE$.$MAP$;
  $typeMap$$1$$.AdfUIComponent = $AdfMarshalingService$$.$_DE$.$ADFUICOMPONENT$;
  $typeMap$$1$$.AdfKeyStroke = $AdfMarshalingService$$.$_DE$.$ADFKEYSTROKE$;
  this.$_typeMap$ = $typeMap$$1$$;
};
$AdfMarshalingService$$.$_DE$.$ARRAY_NULL_ELEM$ = "o";
$AdfMarshalingService$$.$_DE$.$KEY_ELEM$ = "k";
$AdfMarshalingService$$.$_DE$.$VALUE_ATTR$ = "v";
$AdfMarshalingService$$.$_DE$.$COUNT_ATTR$ = "n";
$AdfMarshalingService$$.$_DE$.$NUMBER$ = "n";
$AdfMarshalingService$$.$_DE$.$BOOLEAN$ = "b";
$AdfMarshalingService$$.$_DE$.$STRING$ = "s";
$AdfMarshalingService$$.$_DE$.$DATE$ = "d";
$AdfMarshalingService$$.$_DE$.$ARRAY$ = "a";
$AdfMarshalingService$$.$_DE$.$MAP$ = "m";
$AdfMarshalingService$$.$_DE$.$ADFUICOMPONENT$ = "AdfUIComponent";
$AdfMarshalingService$$.$_DE$.$ADFKEYSTROKE$ = "AdfKeyStroke";
$AdfMarshalingService$$.$_DE$.prototype.encode = function $$AdfMarshalingService$$$$_DE$$$encode$($elem$$5$$, $obj$$37$$, $objStack$$1$$, $service$$1$$) {
  var $value$$156$$ = null, $doc$$31$$ = $elem$$5$$.ownerDocument, $keyNode_node$$60_type$$151$$ = $obj$$37$$.constructor;
  if ($keyNode_node$$60_type$$151$$ == String || $keyNode_node$$60_type$$151$$ == Number) {
    $value$$156$$ = $obj$$37$$;
  } else {
    if ($keyNode_node$$60_type$$151$$ == Boolean) {
      $value$$156$$ = $obj$$37$$ ? "1" : "0";
    } else {
      if ($keyNode_node$$60_type$$151$$ == Date) {
        $value$$156$$ = $obj$$37$$.getTime();
      } else {
        if ($keyNode_node$$60_type$$151$$ == Array) {
          for (var $i$$114_j$$10$$ = 0;$i$$114_j$$10$$ < $obj$$37$$.length;$i$$114_j$$10$$++) {
            $keyNode_node$$60_type$$151$$ = null, null != $obj$$37$$[$i$$114_j$$10$$] && ($keyNode_node$$60_type$$151$$ = $service$$1$$.$marshal$($elem$$5$$, $obj$$37$$[$i$$114_j$$10$$], $objStack$$1$$)), null == $keyNode_node$$60_type$$151$$ && $elem$$5$$.appendChild($AdfMarshalingService$$.$_createElementNS$($doc$$31$$, $AdfMarshalingService$$.$_DE$.$ARRAY_NULL_ELEM$));
          }
          $elem$$5$$.setAttribute($AdfMarshalingService$$.$_DE$.$COUNT_ATTR$, $obj$$37$$.length);
        } else {
          if ($keyNode_node$$60_type$$151$$ == Object) {
            for ($i$$114_j$$10$$ in $obj$$37$$) {
              $keyNode_node$$60_type$$151$$ = $AdfMarshalingService$$.$_createElementNS$($doc$$31$$, $AdfMarshalingService$$.$_DE$.$KEY_ELEM$), $keyNode_node$$60_type$$151$$.setAttribute($AdfMarshalingService$$.$_DE$.$VALUE_ATTR$, $i$$114_j$$10$$), $elem$$5$$.appendChild($keyNode_node$$60_type$$151$$), null != $obj$$37$$[$i$$114_j$$10$$] && $service$$1$$.$marshal$($keyNode_node$$60_type$$151$$, $obj$$37$$[$i$$114_j$$10$$], $objStack$$1$$);
            }
          } else {
            if ($AdfUIComponent$$.prototype.isPrototypeOf($obj$$37$$)) {
              $value$$156$$ = $obj$$37$$.$getClientId$();
            } else {
              if ($AdfKeyStroke$$.prototype.isPrototypeOf($obj$$37$$)) {
                $value$$156$$ = $obj$$37$$.$toMarshalledString$();
              } else {
                for (var $k$$7$$ in $obj$$37$$) {
                  try {
                    var $propObj$$ = $obj$$37$$[$k$$7$$];
                    if (null != $propObj$$ && "function" != typeof $propObj$$) {
                      var $objKeyNode$$ = $AdfMarshalingService$$.$_createElementNS$($doc$$31$$, $AdfMarshalingService$$.$_DE$.$KEY_ELEM$);
                      $objKeyNode$$.setAttribute($AdfMarshalingService$$.$_DE$.$VALUE_ATTR$, $k$$7$$);
                      $elem$$5$$.appendChild($objKeyNode$$);
                      $service$$1$$.$marshal$($objKeyNode$$, $propObj$$, $objStack$$1$$);
                    }
                  } catch ($exp$$) {
                    $AdfLogger$$.$LOGGER$.$logErrorAsWarning$($exp$$, "Error in marshaling object");
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  null != $value$$156$$ && $elem$$5$$.appendChild($doc$$31$$.createTextNode($value$$156$$.toString()));
};
