Example usage for java.lang Boolean booleanValue

List of usage examples for java.lang Boolean booleanValue

Introduction

In this page you can find the example usage for java.lang Boolean booleanValue.

Prototype

@HotSpotIntrinsicCandidate
public boolean booleanValue() 

Source Link

Document

Returns the value of this Boolean object as a boolean primitive.

Usage

From source file:com.admc.jcreole.CreoleParseTest.java

public CreoleParseTest(File creoleFile, File htmlExpectFile, File htmlFile, Boolean doSucceed) {
    this.creoleFile = creoleFile;
    this.htmlExpectFile = htmlExpectFile;
    this.htmlFile = htmlFile;
    shouldSucceed = doSucceed.booleanValue();
}

From source file:com.alfaariss.oa.util.saml2.binding.artifact.HTTPArtifactEncodingFactory.java

/**
 * Create a JSP based HTTP Artifact encoder.
 * @see AbstractEncodingFactory#getEncoder()
 *//*  w  ww  .j a  va  2  s.  c  o m*/
@Override
public SAMLMessageEncoder getEncoder() throws OAException {
    try {
        //Retrieve service
        SAMLArtifactMap artifactMap = ArtifactStoreFactory.getInstance().getStoreInstance();

        String sPath = _prop.getProperty(SAMLConstants.SAML2_ARTIFACT_BINDING_URI, "path");

        JSPHTTPArtifactEncoder encoder = new JSPHTTPArtifactEncoder(sPath, artifactMap);

        Boolean boolPost = _prop.getBooleanProperty(SAMLConstants.SAML2_ARTIFACT_BINDING_URI, "post");
        encoder.setPostEncoding(boolPost);

        if (boolPost.booleanValue() && sPath == null) {
            _logger.error("No 'path' configured for binding");
            throw new OAException(SystemErrors.ERROR_INTERNAL);
        }

        return encoder;
    } catch (OAException e) {
        throw e;
    } catch (Exception e) {
        _logger.fatal("Could not create JSPHTTPArtifactEncoder", e);
        throw new OAException(SystemErrors.ERROR_INTERNAL);
    }
}

From source file:com.bstek.dorado.data.entity.BeanEntityEnhancer.java

@Override
public void writeProperty(Object entity, String property, Object value) throws Throwable {
    Boolean writable = properties.get(property);
    boolean isExProp = !(writable != null && writable.booleanValue());
    if (interceptWriteMethod(entity, property, value, isExProp)) {
        internalWriteProperty(entity, property, value, isExProp);
    }//ww w .  j ava 2 s.c o  m
}

From source file:com.btoddb.chronicle.Event.java

@JsonCreator
public Event(@JsonProperty("headers") Map<String, String> headers, @JsonProperty("body") String body,
        @JsonProperty("bodyIsText") Boolean bodyIsText) {
    this.headers = headers;
    this.bodyIsText = null != bodyIsText ? bodyIsText.booleanValue() : true;
    if (this.bodyIsText) {
        this.body = body.getBytes();
    } else {//  w  w  w .  j  a v a  2s  . c o m
        this.body = Base64.decodeBase64(body);
    }
}

From source file:com.louding.frame.http.download.RetryHandler.java

@Override
public boolean retryRequest(IOException exception, int executionCount, HttpContext context) {
    // ??/*from w w w .j  a v a 2 s  .c o  m*/
    boolean retry = true;

    // ?
    Boolean b = (Boolean) context.getAttribute(ExecutionContext.HTTP_REQ_SENT);
    boolean sent = (b != null && b.booleanValue());

    if (executionCount > maxRetries) {
        // ????
        retry = false;
    } else if (isInList(exceptionBlacklist, exception)) {
        // ??????
        retry = false;
    } else if (isInList(exceptionWhitelist, exception)) {
        // ????
        retry = true;
    } else if (!sent) {
        // ?????
        retry = true;
    }

    if (retry) {
        // resend all idempotent requests
        HttpUriRequest currentReq = (HttpUriRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
        String requestType = currentReq.getMethod();
        retry = !requestType.equals("POST");
    }

    if (retry) {
        SystemClock.sleep(RETRY_SLEEP_TIME_MILLIS);
    } else {
        exception.printStackTrace();
    }
    return retry;
}

From source file:de.berlios.jedi.presentation.admin.LoginFilter.java

/**
 * Checks if the admin is logged in<br>
 * If admin isn't logged in, a forward to the login view is made.<br>
 * If admin is already logged in, the next element in the chain is invoked.
 * /*from  w  ww  .  j  ava 2  s . co m*/
 * @throws IOException
 *             If an IOException occurs when filtering.
 * @throws ServletException
 *             If a ServletException occurs when filtering.
 * 
 * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest,
 *      javax.servlet.ServletResponse, javax.servlet.FilterChain)
 */
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {

    if (!(request instanceof HttpServletRequest)) {
        LogFactory.getLog(LoginFilter.class)
                .error("Unexpected error: request in LoginFilter" + "isn't a HttpServletRequest");
        throw new ServletException("Unexpected error: request in LoginFilter" + "isn't a HttpServletRequest");
    }

    HttpServletRequest httpRequest = (HttpServletRequest) request;
    Boolean isLoggedIn = (Boolean) httpRequest.getSession().getAttribute(AdminKeys.IS_LOGGED_IN);

    try {
        if (isLoggedIn == null || !isLoggedIn.booleanValue()) {
            httpRequest.getSession().getServletContext().getRequestDispatcher("/Admin/LoginView.do")
                    .forward(request, response);
            return;
        }

        chain.doFilter(request, response);
    } catch (IOException e) {
        LogFactory.getLog(LoginFilter.class).error("IOException in LoginFilter", e);
        throw e;
    } catch (ServletException e) {
        LogFactory.getLog(LoginFilter.class).error("ServletException in LoginFilter", e);
        throw e;
    }
}

From source file:com.kulik.android.jaxb.library.composer.providers.jsonProvider.JSONObjectProvider.java

@Override
public void putValueBoolean(String valueName, Boolean value) {
    try {//w w w .  jav a 2 s . c  om
        mJSONObject.put(valueName, value.booleanValue());
    } catch (JSONException e) {
        Log.e(TAG, e.toString());
    }
}

From source file:com.konakart.bl.modules.ordertotal.thomson.HeaderLoggingHandler.java

/**
 * Outputs the soap msg to the logger/*from w  w  w.  j  a  v a  2  s  .c  om*/
 * 
 * @param context
 */
public void logSoapMsg(SOAPMessageContext context) {
    if (!log.isDebugEnabled()) {
        return;
    }

    Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    String msgType = null;
    if (outboundProperty.booleanValue()) {
        msgType = "Request:";
    } else {
        msgType = "Response:";
    }

    SOAPMessage message = context.getMessage();
    try {
        TransformerFactory tff = TransformerFactory.newInstance();
        Transformer tf = tff.newTransformer();

        // Set formatting

        tf.setOutputProperty(OutputKeys.INDENT, "yes");
        tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");

        Source sc = message.getSOAPPart().getContent();

        ByteArrayOutputStream streamOut = new ByteArrayOutputStream();
        StreamResult result = new StreamResult(streamOut);
        tf.transform(sc, result);

        if (log.isDebugEnabled()) {
            log.debug(msgType + "\n" + streamOut.toString()
                    + "\n------------------------------------------------------------------------");
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

From source file:com.konakart.bl.modules.ordertotal.thomson.HeaderSecrityHandler.java

public boolean handleMessage(SOAPMessageContext smc) {
    Boolean outboundProperty = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);

    if (outboundProperty.booleanValue()) {
        SOAPMessage message = smc.getMessage();

        if (log.isInfoEnabled()) {
            log.info("Adding Credentials : " + getUName() + "/" + getPWord());
        }/*from ww w .jav a  2s. co  m*/

        try {
            SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
            envelope.setPrefix("soapenv");
            envelope.getBody().setPrefix("soapenv");

            SOAPHeader header = envelope.addHeader();
            SOAPElement security = header.addChildElement("Security", "wsse",
                    "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");

            SOAPElement usernameToken = security.addChildElement("UsernameToken", "wsse");
            usernameToken.addAttribute(new QName("wsu:Id"), "UsernameToken-1");
            usernameToken.setAttribute("wsu:Id", "UsernameToken-1");

            usernameToken.addAttribute(new QName("xmlns:wsu"),
                    "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");

            SOAPElement username = usernameToken.addChildElement("Username", "wsse");
            username.addTextNode(getUName());

            SOAPElement password = usernameToken.addChildElement("Password", "wsse");
            password.setAttribute("Type",
                    "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText");
            password.addTextNode(getPWord());

            SOAPElement encodingType = usernameToken.addChildElement("Nonce", "wsse");
            encodingType.setAttribute("EncodingType",
                    "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary");
            encodingType.addTextNode("Encoding");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    return outboundProperty;
}

From source file:MutableBoolean.java

/**
 * Constructs a new MutableBoolean with the specified value.
 * //  www  .  j  a  v  a 2 s. c om
 * @param value
 *            a value.
 * @throws NullPointerException
 *             if the object is null
 */
public MutableBoolean(Boolean value) {
    super();
    this.value = value.booleanValue();
}