List of usage examples for java.text ParseException getMessage
public String getMessage()
From source file:net.sourceforge.msscodefactory.cflib.v1_11.CFLib.Swing.CFJFloatEditor.java
public boolean isEditValid() { final String S_ProcName = "isEditValid"; if (!hasValue()) { setValue(null);//from w w w . j a v a2 s .c o m return (true); } boolean retval = super.isEditValid(); if (retval) { try { commitEdit(); } catch (ParseException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Field is not valid - " + e.getMessage(), e); } Object obj = getValue(); if (obj == null) { retval = false; } else if (obj instanceof Float) { Float v = (Float) obj; Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { retval = false; } } else if (obj instanceof Double) { Double v = (Double) obj; Double min = getMinValue().doubleValue(); Double max = getMaxValue().doubleValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { retval = false; } } else if (obj instanceof Short) { Short s = (Short) obj; Float v = new Float(s.floatValue()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { retval = false; } } else if (obj instanceof Integer) { Integer i = (Integer) obj; Float v = new Float(i.floatValue()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { retval = false; } } else if (obj instanceof Long) { Long l = (Long) obj; Float v = new Float(l.floatValue()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { retval = false; } } else if (obj instanceof BigDecimal) { BigDecimal b = (BigDecimal) obj; Float v = new Float(b.toString()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { retval = false; } } else if (obj instanceof Number) { Number n = (Number) obj; Float v = new Float(n.toString()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { retval = false; } } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "EditedValue", obj, "Short, Integer, Long, BigDecimal, Float, Double or Number"); } } return (retval); }
From source file:org.apereo.openlrs.storage.aws.elasticsearch.XApiOnlyAwsElasticsearchTierTwoStorage.java
@Override public Page<OpenLRSEntity> findWithFilters(Map<String, String> filters, Pageable pageable) { int offset = (pageable == null) ? 0 : pageable.getOffset(); int pagesize = (pageable == null) ? 100 : pageable.getPageSize(); String actor = filters.get(StatementUtils.ACTOR_FILTER); String activity = filters.get(StatementUtils.ACTIVITY_FILTER); String since = filters.get(StatementUtils.SINCE_FILTER); String until = filters.get(StatementUtils.UNTIL_FILTER); int limit = getLimit(filters.get(StatementUtils.LIMIT_FILTER)); FilteredQueryBuilder filterQueryBuilder = null; SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); if (StringUtils.isNotBlank(actor)) { String mailbox = String.format("mailto:%s@adlnet.gov", actor); filterQueryBuilder = QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), FilterBuilders.nestedFilter("actor", FilterBuilders.termFilter("actor.mbox", mailbox))); }/*from www . j a v a 2 s. c o m*/ if (StringUtils.isNotBlank(activity)) { if (filterQueryBuilder != null) { filterQueryBuilder = QueryBuilders.filteredQuery(filterQueryBuilder, FilterBuilders.nestedFilter("object", FilterBuilders.termFilter("object.id", activity))); } else { filterQueryBuilder = QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), FilterBuilders.nestedFilter("object", FilterBuilders.termFilter("object.id", activity))); } } if (StringUtils.isNotBlank(since) || StringUtils.isNotBlank(until)) { FilterBuilder rangeFilter = null; if (StringUtils.isNotBlank(since) && StringUtils.isNotBlank(until)) { rangeFilter = FilterBuilders.rangeFilter("stored").from(since).to(until); } else { if (StringUtils.isNotBlank(since)) { rangeFilter = FilterBuilders.rangeFilter("stored").from(since).to("now"); } if (StringUtils.isNotBlank(until)) { try { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); TimeZone tz = TimeZone.getTimeZone("UTC"); formatter.setTimeZone(tz); Date date = (Date) formatter.parse(until); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.YEAR, -1); rangeFilter = FilterBuilders.rangeFilter("stored") .from(formatter.format(calendar.getTime())).to(until); } catch (ParseException e) { log.error(e.getMessage(), e); return null; } } } if (filterQueryBuilder != null) { filterQueryBuilder = QueryBuilders.filteredQuery(filterQueryBuilder, rangeFilter); } else { filterQueryBuilder = QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), rangeFilter); } } if (limit > 0) { pagesize = limit; } searchSourceBuilder.query(filterQueryBuilder).sort("stored", SortOrder.DESC); Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(STATEMENT_INDEX) .addType(STATEMENT_TYPE).setParameter("from", offset).setParameter(Parameters.SIZE, pagesize) .build(); try { SearchResult result = jestClient.execute(search); //TODO remove deprecated. Iterable<Statement> statements = result.getSourceAsObjectList(Statement.class); return createPage(statements); } catch (IOException e) { log.error(e.getMessage(), e); e.printStackTrace(); } return null; }
From source file:com.trailmagic.image.util.ImagesParserImpl.java
private void processCharacterData(String characterData, String currentElt) throws SAXException { if (m_inImage) { if (m_inManifestation) { if ("name".equals(currentElt)) { m_manifestation.setName(characterData); } else if ("height".equals(currentElt)) { m_manifestation.setHeight(Integer.parseInt(characterData)); } else if ("width".equals(currentElt)) { m_manifestation.setWidth(Integer.parseInt(characterData)); } else if ("format".equals(currentElt)) { m_manifestation.setFormat(characterData); } else if ("original".equals(currentElt)) { m_manifestation.setOriginal(new Boolean(characterData).booleanValue()); }/* ww w . ja v a 2 s . co m*/ } else if (m_inPhotoData) { Photo photo = (Photo) m_image; if ("roll-name".equals(currentElt)) { // photo.setRoll(getRollByName(characterData)); // XXX: we should just use ImageGroup for this normally // so make sure the roll exists as an IG, then // XXX: borked if we don't have owner yet synchronized (hibernateTemplate) { hibernateTemplate.flush(); } m_photoRoll = imageGroupRepository.getRollByOwnerAndName(m_image.getOwner(), characterData.trim()); if (m_photoRoll == null) { s_logger.info("No roll by the given name and owner " + "found processing photo data, throwing" + " exception."); throw new SAXException("Invalid or no roll name " + "specified: " + characterData + " (for owner " + m_image.getOwner() + ")"); } } else if ("frame-number".equals(currentElt)) { m_photoFrameNum = characterData; } else if ("notes".equals(currentElt)) { photo.setNotes(characterData); } else if ("capture-date".equals(currentElt)) { // XXX: use DateFormat SimpleDateFormat format = new SimpleDateFormat(DATE_PATTERN); try { photo.setCaptureDate(format.parse(characterData)); } catch (ParseException e) { s_logger.warn("Error parsing capture-date: " + e.getMessage()); } } } else { if ("name".equals(currentElt)) { m_image.setName(characterData); } else if ("display-name".equals(currentElt)) { m_image.setDisplayName(characterData); } else if ("caption".equals(currentElt)) { m_image.setCaption(characterData); } else if ("copyright".equals(currentElt)) { m_image.setCopyright(characterData); } else if ("creator".equals(currentElt)) { m_image.setCreator(characterData); } else if ("owner".equals(currentElt)) { String ownerName = characterData; m_image.setOwner(userRepository.getByScreenName(ownerName)); } else if ("number".equals(currentElt)) { m_image.setNumber(new Integer(characterData)); } } } else if (m_inRoll) { if ("name".equals(currentElt)) { m_roll.setName(characterData); } else if ("display-name".equals(currentElt)) { m_roll.setDisplayName(characterData); } else if ("description".equals(currentElt)) { m_roll.setDescription(characterData); } else if ("owner".equals(currentElt)) { String ownerName = characterData; m_roll.setOwner(userRepository.getByScreenName(ownerName)); s_logger.debug("set roll " + m_roll.getName() + " owner to: " + m_roll.getOwner()); } } }
From source file:net.sourceforge.msscodefactory.cflib.v1_11.CFLib.Swing.CFJFloatEditor.java
public Float getFloatValue() { final String S_ProcName = "getFloatValue"; Float retval;/* ww w . java2 s . c o m*/ String text = getText(); if ((text == null) || (text.length() <= 0)) { retval = null; } else { if (!isEditValid()) { throw CFLib.getDefaultExceptionFactory().newInvalidArgumentException(getClass(), S_ProcName, "Field is not valid"); } try { commitEdit(); } catch (ParseException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Field is not valid - " + e.getMessage(), e); } Object obj = getValue(); if (obj == null) { retval = null; } else if (obj instanceof Float) { Float v = (Float) obj; Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { throw CFLib.getDefaultExceptionFactory().newArgumentRangeException(getClass(), S_ProcName, 0, "EditedValue", v, min, max); } retval = v; } else if (obj instanceof Double) { Double v = (Double) obj; Double min = getMinValue().doubleValue(); Double max = getMaxValue().doubleValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { throw CFLib.getDefaultExceptionFactory().newArgumentRangeException(getClass(), S_ProcName, 0, "EditedValue", v, min, max); } retval = new Float(v.floatValue()); } else if (obj instanceof Short) { Short s = (Short) obj; Float v = new Float(s.floatValue()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { throw CFLib.getDefaultExceptionFactory().newArgumentRangeException(getClass(), S_ProcName, 0, "EditedValue", v, min, max); } retval = v; } else if (obj instanceof Integer) { Integer i = (Integer) obj; Float v = new Float(i.floatValue()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { throw CFLib.getDefaultExceptionFactory().newArgumentRangeException(getClass(), S_ProcName, 0, "EditedValue", v, min, max); } retval = v; } else if (obj instanceof Long) { Long l = (Long) obj; Float v = new Float(l.floatValue()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { throw CFLib.getDefaultExceptionFactory().newArgumentRangeException(getClass(), S_ProcName, 0, "EditedValue", v, min, max); } retval = v; } else if (obj instanceof BigDecimal) { BigDecimal b = (BigDecimal) obj; Float v = new Float(b.toString()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { throw CFLib.getDefaultExceptionFactory().newArgumentRangeException(getClass(), S_ProcName, 0, "EditedValue", v, min, max); } retval = v; } else if (obj instanceof Number) { Number n = (Number) obj; Float v = new Float(n.toString()); Float min = getMinValue(); Float max = getMaxValue(); if ((v.compareTo(min) < 0) || (v.compareTo(max) > 0)) { throw CFLib.getDefaultExceptionFactory().newArgumentRangeException(getClass(), S_ProcName, 0, "EditedValue", v, min, max); } retval = v; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "EditedValue", obj, "Short, Integer, Long, BigDecimal or Number"); } } return (retval); }
From source file:org.dspace.resourcesync.ResourceSyncGenerator.java
public List<ResourceSyncEvent> getChange(String handle) { Date from = null;// ww w . ja va2 s .c o m try { if (fromChangeDump == null) { from = this.getLastChangeListDate(handle); } else { from = fromChangeDump; } } catch (ParseException e) { log.error(e.getMessage(), e); } Date to = new Date(); List<ResourceSyncEvent> rseList = new ArrayList<ResourceSyncEvent>(); ResourceSyncAuditService auditService = new ResourceSyncAuditService(); rseList = auditService.listEvents(from, to, handle); return rseList; }
From source file:com.pinterest.teletraan.worker.AutoPromoter.java
boolean autoDeployDue(DeployBean deployBean, String cronExpressionString) { Date date = new Date(); try {/*from w w w. ja v a2 s .c o m*/ if (!CronExpression.isValidExpression(cronExpressionString)) { LOG.error(String.format("Cron expression %s is not valid. Ignore it.", cronExpressionString)); return true; } CronExpression cronExpression = new CronExpression(cronExpressionString); if (deployBean == null) { return true; } Date lastDeloyDate = new Date(deployBean.getStart_date()); Date nextDeployDate = cronExpression.getNextValidTimeAfter(lastDeloyDate); // Only run the cron deploy when the current date is equal or after the scheduled deploy date // since last deploy. // // If current date is before the next scheduled deploy date since last deploy, return false. if (date.before(nextDeployDate)) { LOG.info(String.format("The next scheduled deploy after last deploy %tc is %tc, now is: %tc", nextDeployDate, lastDeloyDate, date)); return false; } else { return true; } } catch (ParseException e) { LOG.error(String.format("Failed to parse cron expression: %s. Reason: %s", cronExpressionString, e.getMessage())); return true; } catch (Exception e) { LOG.error(String.format("Failed to validate date. Reason: %s", e.getMessage())); return true; } }
From source file:com.alibaba.dubbo.governance.web.common.pulltool.Tool.java
public boolean isInBlackList(Consumer consumer) { String service = consumer.getService(); List<Route> routes = routeService.findForceRouteByService(service); if (routes == null || routes.size() == 0) { return false; }/*from w w w . ja va2 s . c o m*/ String ip = getIP(consumer.getAddress()); for (Route route : routes) { try { if (!route.isEnabled()) { continue; } String filterRule = route.getFilterRule(); if (filterRule == null || filterRule.length() == 0 || "false".equals(filterRule)) { Map<String, MatchPair> rule = RouteRule.parseRule(route.getMatchRule()); MatchPair pair = rule.get("consumer.host"); if (pair == null) { pair = rule.get("host"); } if (pair != null) { if (pair.getMatches() != null && pair.getMatches().size() > 0) { for (String host : pair.getMatches()) { if (ParseUtils.isMatchGlobPattern(host, ip)) { return true; } } } if (pair.getUnmatches() != null && pair.getUnmatches().size() > 0) { boolean forbid = true; for (String host : pair.getUnmatches()) { if (ParseUtils.isMatchGlobPattern(host, ip)) { forbid = false; } } if (forbid) { return true; } } } } } catch (ParseException e) { throw new RuntimeException(e.getMessage(), e); } } return false; }
From source file:com.neusoft.mid.clwapi.service.alarm.AlarmServiceImpl.java
/** * ???/* w ww .j ava 2s . c o m*/ * * @param token * token * @param body * ? * @return */ @Override public Object getAlarmList(String token, String body) { logger.info("???"); String organizationId = context.getHttpHeaders().getHeaderString(UserInfoKey.ORGANIZATION_ID); // ?? AlarmRequ iAlarmRequ = JacksonUtils.fromJsonRuntimeException(body, AlarmRequ.class); // ?? iAlarmRequ.setEndTime(StringUtils.strip(iAlarmRequ.getEndTime())); iAlarmRequ.setStartTime(StringUtils.strip(iAlarmRequ.getStartTime())); iAlarmRequ.setNum(StringUtils.strip(iAlarmRequ.getNum())); iAlarmRequ.setOperat(StringUtils.strip(iAlarmRequ.getOperat())); iAlarmRequ.setOrganizationId(organizationId); // ?? logger.info("??"); if (StringUtils.isEmpty(iAlarmRequ.getOperat()) || StringUtils.isEmpty(iAlarmRequ.getNum()) || StringUtils.isEmpty(iAlarmRequ.getType())) { logger.error("??"); throw new ApplicationException(ErrorConstant.ERROR10001, Response.Status.BAD_REQUEST); } else if (StringUtils.isEmpty(iAlarmRequ.getStartTime()) || StringUtils.isEmpty(iAlarmRequ.getEndTime())) { logger.error("????"); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } else if (HttpConstant.TIME_ZERO.equals(iAlarmRequ.getStartTime()) && HttpConstant.TIME_ZERO.equals(iAlarmRequ.getEndTime())) { logger.error("?????0"); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } else if (HttpConstant.TIME_24_HOURS_AGO.equalsIgnoreCase(iAlarmRequ.getStartTime()) && !HttpConstant.TIME_ZERO.equals(iAlarmRequ.getEndTime())) { logger.error( "??-hh24????0"); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } else if (!StringUtils.isNumeric(iAlarmRequ.getNum())) { logger.error("??num?"); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } else if (!StringUtils.isEmpty(iAlarmRequ.getPage()) && !StringUtils.isNumeric(iAlarmRequ.getPage())) { logger.error("??page?"); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } // page?0 iAlarmRequ.setPage(StringUtils.isEmpty(iAlarmRequ.getPage()) ? HttpConstant.ZERO : iAlarmRequ.getPage()); // ??? int page = Integer.valueOf(iAlarmRequ.getPage()); int num = Integer.valueOf(iAlarmRequ.getNum()); // ???? if (page < 0) { logger.error("??page?0"); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } // ? // if (iAlarmRequ.getOperat().equals(HttpConstant.ALARMPORT_OPERATE_UNTREATED)) { iAlarmRequ.setOperat(HttpConstant.ALARMPORT_OPERATE_UNTREATED_DB); } else if (iAlarmRequ.getOperat().equals(HttpConstant.ALARMPORT_OPERATE_TREATED)) { iAlarmRequ.setOperat(HttpConstant.ALARMPORT_OPERATE_TREATED_DB); } else if (iAlarmRequ.getOperat().equals(HttpConstant.ALARMPORT_OPERATE_ALL)) { iAlarmRequ.setOperat(HttpConstant.ALARMPORT_OPERATE_ALL_DB); } else { logger.error("???operat?0?1?2"); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } if (iAlarmRequ.getType().equals(HttpConstant.ALARMPORT_TYPE_OVERSPEED)) { iAlarmRequ.setSpeedFlag(true); iAlarmRequ.setOverLoadFlag(null); } else if (iAlarmRequ.getType().equals(HttpConstant.ALARMPORT_TYPE_OVERLOAD)) { iAlarmRequ.setSpeedFlag(null); iAlarmRequ.setOverLoadFlag(true); } else if (iAlarmRequ.getType().equals(HttpConstant.ALARMPORT_TYPE_ALL)) { iAlarmRequ.setSpeedFlag(null); iAlarmRequ.setOverLoadFlag(null); } else { logger.error("???type?0?1?2"); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } // ???? if (!HttpConstant.TIME_ZERO.equals(iAlarmRequ.getStartTime()) && !HttpConstant.TIME_24_HOURS_AGO.equalsIgnoreCase(iAlarmRequ.getStartTime())) { try { TimeUtil.parseStringToDate(iAlarmRequ.getStartTime(), HttpConstant.TIME_FORMAT); } catch (ParseException e) { logger.error("????" + e.getMessage()); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } } if (!HttpConstant.TIME_ZERO.equals(iAlarmRequ.getEndTime())) { try { TimeUtil.parseStringToDate(iAlarmRequ.getEndTime(), HttpConstant.TIME_FORMAT); } catch (ParseException e) { logger.error("?????" + e.getMessage()); throw new ApplicationException(ErrorConstant.ERROR10002, Response.Status.BAD_REQUEST); } } logger.info("???"); // ? if (HttpConstant.TIME_ZERO.equals(iAlarmRequ.getStartTime())) { iAlarmRequ.setStartTime(null); } else if (HttpConstant.TIME_24_HOURS_AGO.equalsIgnoreCase(iAlarmRequ.getStartTime())) { Date dBTime = iCommonMapper.getDBTime(); Date oneDayAgo = TimeUtil.get24Ago(dBTime); String startTime = TimeUtil.formatDateToString(oneDayAgo, HttpConstant.TIME_FORMAT); iAlarmRequ.setStartTime(startTime); } if (HttpConstant.TIME_ZERO.equals(iAlarmRequ.getEndTime())) { iAlarmRequ.setEndTime(null); } iAlarmRequ.setEnId(context.getHttpHeaders().getHeaderString(UserInfoKey.ENTERPRISE_ID)); // ? if (page != 0) { iAlarmRequ.setStartRow(String.valueOf(page * num - num)); iAlarmRequ.setEndRow(String.valueOf(page * num)); } else if (num != 0) { iAlarmRequ.setStartRow(HttpConstant.ZERO); iAlarmRequ.setEndRow(String.valueOf(num)); } else { iAlarmRequ.setStartRow(null); iAlarmRequ.setEndRow(null); } logger.info("????"); // ? List<AlarmInfo> temp = iAlarmMapper.getAlarmList(iAlarmRequ); logger.info("??"); // if (temp == null || temp.size() == 0) { logger.info("??"); return Response.noContent().build(); } logger.info("??"); if (logger.isDebugEnabled()) { logger.debug("List size:" + temp.size()); Iterator<AlarmInfo> it = temp.iterator(); while (it.hasNext()) { logger.debug(it.next().toString()); } } // List<AlarmInfo> content = new ArrayList<AlarmInfo>(); Iterator<AlarmInfo> it = temp.iterator(); while (it.hasNext()) { AlarmInfo a = it.next(); if (!StringUtils.isEmpty(a.getSpeeding())) { a.setAlarmCont(a.getSpeeding()); } else if (!StringUtils.isEmpty(a.getPhotoId())) { a.setAlarmCont(a.getPhotoId()); } else { a.setAlarmCont(null); } content.add(a); } // AlarmResp iAlarmResp = new AlarmResp(); iAlarmResp.setContent(content); logger.info("????"); return JacksonUtils.toJsonRuntimeException(iAlarmResp); }
From source file:org.apache.directory.fortress.web.panel.AuditAuthzListPanel.java
private void loadTree(List<AuthZ> authZs) { for (AuthZ authZ : authZs) { Date start = null;// w w w. ja v a 2s .com try { start = TUtil.decodeGeneralizedTime(authZ.getReqStart()); } catch (ParseException pe) { LOG.warn("ParseException=" + pe.getMessage()); } if (start != null) { SimpleDateFormat formatter = new SimpleDateFormat(GlobalIds.AUDIT_TIMESTAMP_FORMAT); String formattedDate = formatter.format(start); authZ.setReqStart(formattedDate); } authZ.setReqResult(GlobalIds.FAILURE); /* TODO: On RC40 - Replace above line with the following: if(StringUtils.isNotEmpty( authZ.getReqAssertion() ) && (authZ.getReqAssertion().equals( org.apache.directory.fortress.core.GlobalIds.AUTH_Z_FAILED_VALUE ) ) ) { authZ.setReqResult( GlobalIds.FAILURE ); } else { authZ.setReqResult( GlobalIds.SUCCESS ); } */ authZ.setReqAuthzID(AuditUtils.getAuthZId(authZ.getReqAuthzID())); AuditUtils.mapAuthZPerm(authZ); rootNode.add(new DefaultMutableTreeNode(authZ)); } }
From source file:com.commander4j.util.JUtility.java
public static BigDecimal stringToBigDecimal(String str) { BigDecimal result;/*from w w w .j a v a2s .c o m*/ NumberFormat nf; nf = NumberFormat.getNumberInstance(Locale.getDefault()); try { Number myNumber = nf.parse(str); Double dbl = myNumber.doubleValue(); result = BigDecimal.valueOf(dbl); str = String.valueOf(dbl); } catch (ParseException e) { final Logger logger = Logger.getLogger(JUtility.class); logger.error(e.getMessage()); str = "0"; result = new BigDecimal("0"); } // result = new BigDecimal(str); return result; }