HttpRequestDecorator.java
/*
** Module : HttpRequestDecorator.java
** Abstract : Implementation of the builtin class.
**
** Copyright (c) 2019-2023, Golden Code Development Corporation.
**
** -#- -I- --Date-- ---------------------------------------Description----------------------------------------
** 001 IAS 20190923 First version.
** 002 MP 20200611 Added missing methods as stubs taken by converting the skeleton using FWD.
** 003 ME 20201105 Set all methods as pass-through to decorated request.
** 20201118 Check if decorated request can be adapted to requested class.
** CA 20210219 OO input parameter definitions for functions/procedures must not register with ObjectOps
** - TypeFactory.initInput will take care of this.
** 004 CA 20210221 Fixed 'qualified', 'extent' and 'returns' annotations at the legacy signature.
** CA 20210609 Updated INPUT/INPUT-OUTPUT parameters to the new approach, where they are explicitly
** initialized at the method's execution, and not at the caller's arguments.
** 005 CA 20230817 Removed ObjectOps.register, as this registration is handled by runtime.
** 006 CA 20231113 The 'execute' method must be annotated with LegacySignature Type.Execute, and also can be
** dropped if is a no-op.
*/
/*
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero General Public License as
** published by the Free Software Foundation, either version 3 of the
** License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU Affero General Public License for more details.
**
** You may find a copy of the GNU Affero GPL version 3 at the following
** location: https://www.gnu.org/licenses/agpl-3.0.en.html
**
** Additional terms under GNU Affero GPL version 3 section 7:
**
** Under Section 7 of the GNU Affero GPL version 3, the following additional
** terms apply to the works covered under the License. These additional terms
** are non-permissive additional terms allowed under Section 7 of the GNU
** Affero GPL version 3 and may not be removed by you.
**
** 0. Attribution Requirement.
**
** You must preserve all legal notices or author attributions in the covered
** work or Appropriate Legal Notices displayed by works containing the covered
** work. You may not remove from the covered work any author or developer
** credit already included within the covered work.
**
** 1. No License To Use Trademarks.
**
** This license does not grant any license or rights to use the trademarks
** Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
** of Golden Code Development Corporation. You are not authorized to use the
** name Golden Code, FWD, or the names of any author or contributor, for
** publicity purposes without written authorization.
**
** 2. No Misrepresentation of Affiliation.
**
** You may not represent yourself as Golden Code Development Corporation or FWD.
**
** You may not represent yourself for publicity purposes as associated with
** Golden Code Development Corporation, FWD, or any author or contributor to
** the covered work, without written authorization.
**
** 3. No Misrepresentation of Source or Origin.
**
** You may not represent the covered work as solely your work. All modified
** versions of the covered work must be marked in a reasonable way to make it
** clear that the modified work is not originating from Golden Code Development
** Corporation or FWD. All modified versions must contain the notices of
** attribution required in this license.
*/
package com.goldencode.p2j.oo.net.http;
import com.goldencode.p2j.oo.core.Assert;
import com.goldencode.p2j.oo.core.IAdaptable;
import com.goldencode.p2j.oo.lang.*;
import com.goldencode.p2j.util.*;
import com.goldencode.p2j.util.BlockManager.Action;
import com.goldencode.p2j.util.BlockManager.Condition;
import com.goldencode.p2j.util.InternalEntry.*;
import static com.goldencode.p2j.report.ReportConstants.*;
import static com.goldencode.p2j.util.BlockManager.externalProcedure;
import static com.goldencode.p2j.util.BlockManager.function;
import static com.goldencode.p2j.util.BlockManager.internalProcedure;
import static com.goldencode.p2j.util.BlockManager.onBlockLevel;
import static com.goldencode.p2j.util.BlockManager.returnNormal;
/**
*
* Decorator class for decorating/customising Http Requests
* without requiring inheritance.
*
*/
@LegacyResource(resource = "OpenEdge.Net.HTTP.HttpRequestDecorator")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
public class HttpRequestDecorator
extends BaseObject
implements com.goldencode.p2j.oo.net.http.IhttpRequest,
com.goldencode.p2j.oo.core.IAdaptable
{
@LegacySignature(type = Type.PROPERTY, name = "DecoratedHttpRequest")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
private object<? extends com.goldencode.p2j.oo.net.http.IhttpRequest> decoratedHttpRequest =
TypeFactory.object(com.goldencode.p2j.oo.net.http.IhttpRequest.class);
@LegacySignature(type = Type.EXECUTE)
public void __net_http_HttpRequestDecorator_execute__()
{
onBlockLevel(Condition.ERROR, Action.THROW);
}
@LegacySignature(returns = "OBJECT", qualified = "OpenEdge.Net.HTTP.IHttpRequest", type = Type.GETTER, name = "DecoratedHttpRequest")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
protected object<? extends com.goldencode.p2j.oo.net.http.IhttpRequest> getDecoratedHttpRequest()
{
return function(HttpRequestDecorator.class, this, "DecoratedHttpRequest", object.class, new Block((Body) () ->
{
returnNormal(decoratedHttpRequest);
}));
}
@LegacySignature(returns = "CHARACTER", type = Type.GETTER, name = "Method")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public character getMethod()
{
return function(HttpRequestDecorator.class, this, "Method", character.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getMethod());
}));
}
@LegacySignature(type = Type.SETTER, name = "Method", parameters =
{
@LegacyParameter(name = "var", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setMethod(final character var)
{
internalProcedure(HttpRequestDecorator.class, this, "Method", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setMethod(var);
}));
}
@LegacySignature(returns = "OBJECT", qualified = "OpenEdge.Net.URI", type = Type.GETTER, name = "URI")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public object<? extends com.goldencode.p2j.oo.net.Uri> getUri()
{
return function(HttpRequestDecorator.class, this, "URI", object.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getUri());
}));
}
@LegacySignature(type = Type.SETTER, name = "URI", parameters =
{
@LegacyParameter(qualified = "OpenEdge.Net.URI", name = "var", type = "OBJECT", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setUri(final object<? extends com.goldencode.p2j.oo.net.Uri> var)
{
internalProcedure(HttpRequestDecorator.class, this, "URI", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setUri(var);
}));
}
@LegacySignature(returns = "CHARACTER", type = Type.GETTER, name = "Version")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public character getVersion()
{
return function(HttpRequestDecorator.class, this, "Version", character.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getVersion());
}));
}
@LegacySignature(type = Type.SETTER, name = "Version", parameters =
{
@LegacyParameter(name = "var", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setVersion(final character var)
{
internalProcedure(HttpRequestDecorator.class, this, "Version", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setVersion(var);
}));
}
@LegacySignature(returns = "CHARACTER", type = Type.GETTER, name = "ContentType")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public character getContentType()
{
return function(HttpRequestDecorator.class, this, "ContentType", character.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getContentType());
}));
}
@LegacySignature(type = Type.SETTER, name = "ContentType", parameters =
{
@LegacyParameter(name = "var", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setContentType(final character var)
{
internalProcedure(HttpRequestDecorator.class, this, "ContentType", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setContentType(var);
}));
}
@LegacySignature(returns = "CHARACTER", type = Type.GETTER, name = "CharacterEncoding")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public character getCharacterEncoding()
{
return function(HttpRequestDecorator.class, this, "CharacterEncoding", character.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getCharacterEncoding());
}));
}
@LegacySignature(type = Type.SETTER, name = "CharacterEncoding", parameters =
{
@LegacyParameter(name = "var", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setCharacterEncoding(final character var)
{
internalProcedure(HttpRequestDecorator.class, this, "CharacterEncoding", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setCharacterEncoding(var);
}));
}
@LegacySignature(returns = "RAW", type = Type.GETTER, name = "ContentMD5")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public raw getContentMd5()
{
return function(HttpRequestDecorator.class, this, "ContentMD5", raw.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getContentMd5());
}));
}
@LegacySignature(type = Type.SETTER, name = "ContentMD5", parameters =
{
@LegacyParameter(name = "var", type = "RAW", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setContentMd5(final raw var)
{
internalProcedure(HttpRequestDecorator.class, this, "ContentMD5", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setContentMd5(var);
}));
}
@LegacySignature(returns = "OBJECT", qualified = "Progress.Lang.Object", type = Type.GETTER, name = "Entity")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public object<? extends com.goldencode.p2j.oo.lang._BaseObject_> getEntity()
{
return function(HttpRequestDecorator.class, this, "Entity", object.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getEntity());
}));
}
@LegacySignature(type = Type.SETTER, name = "Entity", parameters =
{
@LegacyParameter(qualified = "Progress.Lang.Object", name = "var", type = "OBJECT", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setEntity(final object<? extends com.goldencode.p2j.oo.lang._BaseObject_> var)
{
internalProcedure(HttpRequestDecorator.class, this, "Entity", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setEntity(var);
}));
}
@LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "ContentLength")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public integer getContentLength()
{
return function(HttpRequestDecorator.class, this, "ContentLength", integer.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getContentLength());
}));
}
@LegacySignature(type = Type.SETTER, name = "ContentLength", parameters =
{
@LegacyParameter(name = "var", type = "INTEGER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setContentLength(final integer var)
{
internalProcedure(HttpRequestDecorator.class, this, "ContentLength", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setContentLength(var);
}));
}
@LegacySignature(returns = "CHARACTER", type = Type.GETTER, name = "TransferEncoding")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public character getTransferEncoding()
{
return function(HttpRequestDecorator.class, this, "TransferEncoding", character.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getTransferEncoding());
}));
}
@LegacySignature(type = Type.SETTER, name = "TransferEncoding", parameters =
{
@LegacyParameter(name = "var", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setTransferEncoding(final character var)
{
internalProcedure(HttpRequestDecorator.class, this, "TransferEncoding", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setTransferEncoding(var);
}));
}
@LegacySignature(type = Type.CONSTRUCTOR, parameters =
{
@LegacyParameter(name = "poHttpRequest", type = "OBJECT", qualified = "openedge.net.http.ihttprequest", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void __net_http_HttpRequestDecorator_constructor__(final object<? extends com.goldencode.p2j.oo.net.http.IhttpRequest> _poHttpRequest)
{
object<? extends com.goldencode.p2j.oo.net.http.IhttpRequest> poHttpRequest = TypeFactory.initInput(_poHttpRequest);
internalProcedure(HttpRequestDecorator.class, this, "__net_http_HttpRequestDecorator_constructor__", new Block((Body) () ->
{
__lang_BaseObject_constructor__();
Assert.notNull(_poHttpRequest, new character("HttpRequest"));
this.decoratedHttpRequest.assign(poHttpRequest);
}));
}
@LegacySignature(type = Type.METHOD, name = "SetHeader", parameters =
{
@LegacyParameter(name = "poHeader", type = "OBJECT", qualified = "openedge.net.http.httpheader", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setHeader(final object<? extends com.goldencode.p2j.oo.net.http.HttpHeader> poHeader)
{
internalProcedure(HttpRequestDecorator.class, this, "SetHeader", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setHeader(poHeader);
}));
}
@LegacySignature(type = Type.METHOD, name = "SetHeaders", parameters =
{
@LegacyParameter(name = "poHeaders", type = "OBJECT", extent = -1, qualified = "openedge.net.http.httpheader", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setHeaders(final object<? extends com.goldencode.p2j.oo.net.http.HttpHeader>[] poHeaders)
{
internalProcedure(HttpRequestDecorator.class, this, "SetHeaders", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setHeaders(poHeaders);
}));
}
@LegacySignature(returns = "OBJECT", type = Type.METHOD, name = "GetHeader", qualified = "openedge.net.http.httpheader", parameters =
{
@LegacyParameter(name = "pcName", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public object<? extends com.goldencode.p2j.oo.net.http.HttpHeader> getHeader(final character pcName)
{
return function(HttpRequestDecorator.class, this, "GetHeader", object.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getHeader(pcName));
}));
}
@LegacySignature(returns = "INTEGER", type = Type.METHOD, name = "GetHeaders", parameters =
{
@LegacyParameter(name = "extpoHeader", type = "OBJECT", extent = -1, qualified = "openedge.net.http.httpheader", mode = "OUTPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public integer getHeaders(final OutputExtentParameter<object<? extends com.goldencode.p2j.oo.net.http.HttpHeader>> _extpoHeader)
{
object[][] extpoHeader = { TypeFactory.initOutput(_extpoHeader) };
return function(HttpRequestDecorator.class, this, "GetHeaders", integer.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getHeaders(new OutputExtentParameter<object<? extends HttpHeader>>()
{
@Override
public object<? extends HttpHeader>[] getVariable()
{
return extpoHeader[0];
}
@Override
public void setVariable(object<? extends HttpHeader>[] reference)
{
extpoHeader[0] = reference;
}
}));
}));
}
@LegacySignature(type = Type.METHOD, name = "RemoveHeader", parameters =
{
@LegacyParameter(name = "pcName", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void removeHeader(final character _pcName)
{
character pcName = TypeFactory.initInput(_pcName);
internalProcedure(HttpRequestDecorator.class, this, "RemoveHeader", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().removeHeader(pcName);
}));
}
@LegacySignature(returns = "LOGICAL", type = Type.METHOD, name = "HasHeader", parameters =
{
@LegacyParameter(name = "pcName", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public logical hasHeader(final character pcName)
{
return function(HttpRequestDecorator.class, this, "HasHeader", logical.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().hasHeader(pcName));
}));
}
@LegacySignature(type = Type.METHOD, name = "ClearHeaders")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void clearHeaders()
{
internalProcedure(HttpRequestDecorator.class, this, "ClearHeaders", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().clearHeaders();
}));
}
@LegacySignature(type = Type.METHOD, name = "SetCookie", parameters =
{
@LegacyParameter(name = "poCookie", type = "OBJECT", qualified = "openedge.net.http.cookie", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setCookie(final object<? extends com.goldencode.p2j.oo.net.http.Cookie> poCookie)
{
internalProcedure(HttpRequestDecorator.class, this, "SetCookie", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setCookie(poCookie);
}));
}
@LegacySignature(type = Type.METHOD, name = "SetCookies", parameters =
{
@LegacyParameter(name = "poCookies", type = "OBJECT", extent = -1, qualified = "openedge.net.http.cookie", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void setCookies(final object<? extends com.goldencode.p2j.oo.net.http.Cookie>[] poCookies)
{
internalProcedure(HttpRequestDecorator.class, this, "SetCookies", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().setCookies(poCookies);
}));
}
@LegacySignature(returns = "INTEGER", type = Type.METHOD, name = "GetCookies", parameters =
{
@LegacyParameter(name = "extpoCookies", type = "OBJECT", extent = -1, qualified = "openedge.net.http.cookie", mode = "OUTPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public integer getCookies(final OutputExtentParameter<object<? extends com.goldencode.p2j.oo.net.http.Cookie>> _extpoCookies)
{
object[][] extpoCookies = { TypeFactory.initOutput(_extpoCookies) };
return function(HttpRequestDecorator.class, this, "GetCookies", integer.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getCookies(new OutputExtentParameter<object<? extends Cookie>>()
{
@Override
public object<? extends Cookie>[] getVariable()
{
return extpoCookies[0];
}
@Override
public void setVariable(object<? extends Cookie>[] reference)
{
extpoCookies[0] = reference;
}
}));
}));
}
@LegacySignature(type = Type.METHOD, name = "RemoveCookie", parameters =
{
@LegacyParameter(name = "poCookie", type = "OBJECT", qualified = "openedge.net.http.cookie", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void removeCookie(final object<? extends com.goldencode.p2j.oo.net.http.Cookie> poCookie)
{
internalProcedure(HttpRequestDecorator.class, this, "RemoveCookie", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().removeCookie(poCookie);
}));
}
@LegacySignature(returns = "LOGICAL", type = Type.METHOD, name = "HasCookie", parameters =
{
@LegacyParameter(name = "poCookie", type = "OBJECT", qualified = "openedge.net.http.cookie", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public logical hasCookie(final object<? extends com.goldencode.p2j.oo.net.http.Cookie> poCookie)
{
return function(HttpRequestDecorator.class, this, "HasCookie", logical.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().hasCookie(poCookie));
}));
}
@LegacySignature(type = Type.METHOD, name = "ClearCookies")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void clearCookies()
{
internalProcedure(HttpRequestDecorator.class, this, "ClearCookies", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().clearCookies();
}));
}
@LegacySignature(type = Type.METHOD, name = "RemoveCookie", parameters =
{
@LegacyParameter(name = "pcName", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public void removeCookie(final character pcName)
{
internalProcedure(HttpRequestDecorator.class, this, "RemoveCookie", new Block((Body) () ->
{
this.decoratedHttpRequest.ref().removeCookie(pcName);
}));
}
@LegacySignature(returns = "LOGICAL", type = Type.METHOD, name = "HasCookie", parameters =
{
@LegacyParameter(name = "pcName", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public logical hasCookie(final character pcName)
{
return function(HttpRequestDecorator.class, this, "HasCookie", logical.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().hasCookie(pcName));
}));
}
@LegacySignature(returns = "OBJECT", type = Type.METHOD, name = "GetCookie", qualified = "openedge.net.http.cookie", parameters =
{
@LegacyParameter(name = "pcName", type = "CHARACTER", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public object<? extends com.goldencode.p2j.oo.net.http.Cookie> getCookie(final character pcName)
{
return function(HttpRequestDecorator.class, this, "GetCookie", object.class, new Block((Body) () ->
{
returnNormal(this.decoratedHttpRequest.ref().getCookie(pcName));
}));
}
@LegacySignature(returns = "OBJECT", type = Type.METHOD, name = "GetAdapter", qualified = "progress.lang.object", parameters =
{
@LegacyParameter(name = "poAdaptTo", type = "OBJECT", qualified = "progress.lang.class", mode = "INPUT")
})
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public object<? extends com.goldencode.p2j.oo.lang._BaseObject_> getAdapter(final object<? extends com.goldencode.p2j.oo.lang.LegacyClass> _poAdaptTo)
{
object<? extends com.goldencode.p2j.oo.lang.LegacyClass> poAdaptTo = TypeFactory.initInput(_poAdaptTo);
return function(HttpRequestDecorator.class, this, "GetAdapter", object.class, new Block((Body) () ->
{
Assert.notNull(poAdaptTo, new character("Adapter"));
if (getLegacyClass().ref()._isA(poAdaptTo))
returnNormal(ObjectOps.thisObject());
if (ObjectOps.typeOf(decoratedHttpRequest, IAdaptable.class).booleanValue())
returnNormal(ObjectOps.cast(decoratedHttpRequest, IAdaptable.class).ref().getAdapter(poAdaptTo));
returnNormal(new object());
}));
}
}