Example usage for java.security InvalidParameterException InvalidParameterException

List of usage examples for java.security InvalidParameterException InvalidParameterException

Introduction

In this page you can find the example usage for java.security InvalidParameterException InvalidParameterException.

Prototype

public InvalidParameterException(String msg) 

Source Link

Document

Constructs an InvalidParameterException with the specified detail message.

Usage

From source file:com.borax12.materialdaterangepicker.date.MonthView.java

/**
 * Sets all the parameters for displaying this week. The only required
 * parameter is the week number. Other parameters have a default value and
 * will only update if a new value is included, except for focus month,
 * which will always default to no focus month if no value is passed in. See
 * {@link #VIEW_PARAMS_HEIGHT} for more info on parameters.
 *
 * @param params A map of the new parameters, see
 *            {@link #VIEW_PARAMS_HEIGHT}
 *///from w ww  .j  ava2s  .c om
public void setMonthParams(HashMap<String, Integer> params) {
    if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
        throw new InvalidParameterException("You must specify month and year for this view");
    }
    setTag(params);
    // We keep the current value for any params not present
    if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
        mRowHeight = params.get(VIEW_PARAMS_HEIGHT);
        if (mRowHeight < MIN_HEIGHT) {
            mRowHeight = MIN_HEIGHT;
        }
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
        mSelectedDay = params.get(VIEW_PARAMS_SELECTED_DAY);
    }

    // Allocate space for caching the day numbers and focus values
    mMonth = params.get(VIEW_PARAMS_MONTH);
    mYear = params.get(VIEW_PARAMS_YEAR);

    // Figure out what day today is
    //final Time today = new Time(Time.getCurrentTimezone());
    //today.setToNow();
    final Calendar today = Calendar.getInstance();
    mHasToday = false;
    mToday = -1;

    mCalendar.set(Calendar.MONTH, mMonth);
    mCalendar.set(Calendar.YEAR, mYear);
    mCalendar.set(Calendar.DAY_OF_MONTH, 1);
    mDayOfWeekStart = mCalendar.get(Calendar.DAY_OF_WEEK);

    if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
        mWeekStart = params.get(VIEW_PARAMS_WEEK_START);
    } else {
        mWeekStart = mCalendar.getFirstDayOfWeek();
    }

    mNumCells = mCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    for (int i = 0; i < mNumCells; i++) {
        final int day = i + 1;
        if (sameDay(day, today)) {
            mHasToday = true;
            mToday = day;
        }
    }
    mNumRows = calculateNumRows();

    // Invalidate cached accessibility information.
    mTouchHelper.invalidateRoot();
}

From source file:com.mohamadamin.persianmaterialdatetimepicker.date.MonthView.java

/**
 * Sets all the parameters for displaying this week. The only required
 * parameter is the week number. Other parameters have a default value and
 * will only update if a new value is included, except for focus month,
 * which will always default to no focus month if no value is passed in. See
 * {@link #VIEW_PARAMS_HEIGHT} for more info on parameters.
 *
 * @param params A map of the new parameters, see
 *            {@link #VIEW_PARAMS_HEIGHT}
 *///  w ww .  j av a  2s . co  m
public void setMonthParams(HashMap<String, Integer> params) {
    if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
        throw new InvalidParameterException("You must specify month and year for this view");
    }
    setTag(params);
    // We keep the current value for any params not present
    if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
        mRowHeight = params.get(VIEW_PARAMS_HEIGHT);
        if (mRowHeight < MIN_HEIGHT) {
            mRowHeight = MIN_HEIGHT;
        }
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
        mSelectedDay = params.get(VIEW_PARAMS_SELECTED_DAY);
    }

    // Allocate space for caching the day numbers and focus values
    mMonth = params.get(VIEW_PARAMS_MONTH);
    mYear = params.get(VIEW_PARAMS_YEAR);

    // Figure out what day today is
    //final Time today = new Time(Time.getCurrentTimezone());
    //today.setToNow();
    final PersianCalendar today = new PersianCalendar();
    mHasToday = false;
    mToday = -1;

    mPersianCalendar.setPersianDate(mYear, mMonth, 1);
    mDayOfWeekStart = mPersianCalendar.get(Calendar.DAY_OF_WEEK);

    if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
        mWeekStart = params.get(VIEW_PARAMS_WEEK_START);
    } else {
        mWeekStart = Calendar.SATURDAY;
    }

    mNumCells = Utils.getDaysInMonth(mMonth, mYear);
    for (int i = 0; i < mNumCells; i++) {
        final int day = i + 1;
        if (sameDay(day, today)) {
            mHasToday = true;
            mToday = day;
        }
    }
    mNumRows = calculateNumRows();

    // Invalidate cached accessibility information.
    mTouchHelper.invalidateRoot();
}

From source file:com.mohamadamin.persianmaterialdatetimepicker.multidate.MonthView.java

/**
 * Sets all the parameters for displaying this week. The only required
 * parameter is the week number. Other parameters have a default value and
 * will only update if a new value is included, except for focus month,
 * which will always default to no focus month if no value is passed in. See
 * {@link #VIEW_PARAMS_HEIGHT} for more info on parameters.
 *
 * @param params A map of the new parameters, see
 *            {@link #VIEW_PARAMS_HEIGHT}
 *//* w w  w  .  j av  a  2  s  .  c o  m*/
public void setMonthParams(HashMap<String, Object> params) {
    if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
        throw new InvalidParameterException("You must specify month and year for this view");
    }
    setTag(params);
    // We keep the current value for any params not present
    if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
        mRowHeight = (int) params.get(VIEW_PARAMS_HEIGHT);
        if (mRowHeight < MIN_HEIGHT) {
            mRowHeight = MIN_HEIGHT;
        }
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
        mSelectedDay = (int) params.get(VIEW_PARAMS_SELECTED_DAY);
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAYS)) {
        mSelectedDays = (ArrayList<Integer>) params.get(VIEW_PARAMS_SELECTED_DAYS);
    }
    // Allocate space for caching the day numbers and focus values
    mMonth = (int) params.get(VIEW_PARAMS_MONTH);
    mYear = (int) params.get(VIEW_PARAMS_YEAR);

    // Figure out what day today is
    //final Time today = new Time(Time.getCurrentTimezone());
    //today.setToNow();
    final PersianCalendar today = new PersianCalendar();
    mHasToday = false;
    mToday = -1;

    mPersianCalendar.setPersianDate(mYear, mMonth, 1);
    mDayOfWeekStart = mPersianCalendar.get(Calendar.DAY_OF_WEEK);

    if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
        mWeekStart = (int) params.get(VIEW_PARAMS_WEEK_START);
    } else {
        mWeekStart = Calendar.SATURDAY;
    }

    mNumCells = Utils.getDaysInMonth(mMonth, mYear);
    for (int i = 0; i < mNumCells; i++) {
        final int day = i + 1;
        if (sameDay(day, today)) {
            mHasToday = true;
            mToday = day;
        }
    }
    mNumRows = calculateNumRows();

    // Invalidate cached accessibility information.
    mTouchHelper.invalidateRoot();
}

From source file:com.wdullaer.materialdatetimepicker.date.MonthView.java

/**
 * Sets all the parameters for displaying this week. The only required
 * parameter is the week number. Other parameters have a default value and
 * will only update if a new value is included, except for focus month,
 * which will always default to no focus month if no value is passed in. See
 * {@link #VIEW_PARAMS_HEIGHT} for more info on parameters.
 *
 * @param params A map of the new parameters, see
 *            {@link #VIEW_PARAMS_HEIGHT}
 *//*from  ww  w. j  a va 2  s  .c om*/
public void setMonthParams(HashMap<String, Integer> params) {
    if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
        throw new InvalidParameterException("You must specify month and year for this view");
    }
    setTag(params);
    // We keep the current value for any params not present
    if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
        mRowHeight = params.get(VIEW_PARAMS_HEIGHT);
        if (mRowHeight < MIN_HEIGHT) {
            mRowHeight = MIN_HEIGHT;
        }
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
        mSelectedDay = params.get(VIEW_PARAMS_SELECTED_DAY);
    }

    // Allocate space for caching the day numbers and focus values
    mMonth = params.get(VIEW_PARAMS_MONTH);
    mYear = params.get(VIEW_PARAMS_YEAR);

    // Figure out what day today is
    //final Time today = new Time(Time.getCurrentTimezone());
    //today.setToNow();
    final Calendar today = Calendar.getInstance(mController.getTimeZone());
    mHasToday = false;
    mToday = -1;

    mCalendar.set(Calendar.MONTH, mMonth);
    mCalendar.set(Calendar.YEAR, mYear);
    mCalendar.set(Calendar.DAY_OF_MONTH, 1);
    mDayOfWeekStart = mCalendar.get(Calendar.DAY_OF_WEEK);

    if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
        mWeekStart = params.get(VIEW_PARAMS_WEEK_START);
    } else {
        mWeekStart = mCalendar.getFirstDayOfWeek();
    }

    mNumCells = mCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    for (int i = 0; i < mNumCells; i++) {
        final int day = i + 1;
        if (sameDay(day, today)) {
            mHasToday = true;
            mToday = day;
        }
    }
    mNumRows = calculateNumRows();

    // Invalidate cached accessibility information.
    mTouchHelper.invalidateRoot();
}

From source file:org.easyxml.xml.Document.java

public String toJSON(String objectPath) {

    if (objectPath == null || !containsElement(objectPath))

        return null;

    Map<String, String> pathToKeys = new LinkedHashMap<String, String>();

    for (Map.Entry<String, List<Element>> entry : this.children.entrySet()) {

        String originalPath = entry.getKey();

        if (!originalPath.startsWith(objectPath)) {

            continue;

        }/*from www .  j av  a 2s  .co  m*/

        String relativePath = originalPath.equals(objectPath) ? ""
                : originalPath.substring(objectPath.length() + 1);

        String elementName = elementNameOf(originalPath);

        if (!pathToKeys.containsKey(relativePath)) {

            pathToKeys.put(relativePath, elementName);

        } else

            throw new InvalidParameterException("Duplicated definitionf of " + entry);

    }

    List<Element> objectElements = getElementsOf(objectPath);

    return getJsonStringOf(objectElements, pathToKeys);

}

From source file:com.appsimobile.appsii.module.appsiagenda.MonthView.java

/**
 * Sets all the parameters for displaying this week. The only required
 * parameter is the week number. Other parameters have a default value and
 * will only update if a new value is included, except for focus month,
 * which will always default to no focus month if no value is passed in. See
 * {@link #VIEW_PARAMS_HEIGHT} for more info on parameters.
 *
 * @param params A map of the new parameters, see
 * {@link #VIEW_PARAMS_HEIGHT}/*from  w  w  w .j a  v  a 2 s  . c  o m*/
 */
public void setMonthParams(SimpleArrayMap<String, Integer> params) {
    if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
        throw new InvalidParameterException("You must specify month and year for this view");
    }
    setTag(params);
    // We keep the current value for any params not present
    if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
        mRowHeight = params.get(VIEW_PARAMS_HEIGHT);
        if (mRowHeight < MIN_HEIGHT) {
            mRowHeight = MIN_HEIGHT;
        }
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
        mSelectedDay = params.get(VIEW_PARAMS_SELECTED_DAY);
    }

    mStartJulianDay = params.get(VIEW_PARAMS_START_JULIAN_DAY);

    // Allocate space for caching the day numbers and focus values
    mMonth = params.get(VIEW_PARAMS_MONTH);
    mYear = params.get(VIEW_PARAMS_YEAR);

    // Figure out what day today is
    final Time today = new Time(Time.getCurrentTimezone());
    today.setToNow();
    mHasToday = false;
    mToday = -1;

    mCalendar.set(Calendar.MONTH, mMonth);
    mCalendar.set(Calendar.YEAR, mYear);
    mCalendar.set(Calendar.DAY_OF_MONTH, 1);
    mDayOfWeekStart = mCalendar.get(Calendar.DAY_OF_WEEK);

    if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
        mWeekStart = params.get(VIEW_PARAMS_WEEK_START);
    } else {
        mWeekStart = mCalendar.getFirstDayOfWeek();
    }

    mNumCells = Utils.getDaysInMonth(mMonth, mYear);
    for (int i = 0; i < mNumCells; i++) {
        final int day = i + 1;
        if (sameDay(day, today)) {
            mHasToday = true;
            mToday = day;
        }
    }
    mNumRows = calculateNumRows();

    // Invalidate cached accessibility information.
    mTouchHelper.invalidateRoot();
}

From source file:org.apache.flink.api.java.operators.CoGroupOperator.java

private static <I1, I2, K, OUT> PlanLeftUnwrappingCoGroupOperator<I1, I2, OUT, K> translateSelectorFunctionCoGroupLeft(
        SelectorFunctionKeys<I1, ?> rawKeys1, int[] logicalKeyPositions2, CoGroupFunction<I1, I2, OUT> function,
        TypeInformation<I2> inputType2, TypeInformation<OUT> outputType, String name, Operator<I1> input1,
        Operator<I2> input2) {//from w ww . java 2 s. co m
    if (!inputType2.isTupleType()) {
        throw new InvalidParameterException("Should not happen.");
    }

    @SuppressWarnings("unchecked")
    final SelectorFunctionKeys<I1, K> keys1 = (SelectorFunctionKeys<I1, K>) rawKeys1;
    final TypeInformation<Tuple2<K, I1>> typeInfoWithKey1 = KeyFunctions.createTypeWithKey(keys1);
    final Operator<Tuple2<K, I1>> keyedInput1 = KeyFunctions.appendKeyExtractor(input1, keys1);

    final PlanLeftUnwrappingCoGroupOperator<I1, I2, OUT, K> cogroup = new PlanLeftUnwrappingCoGroupOperator<>(
            function, keys1, logicalKeyPositions2, name, outputType, typeInfoWithKey1, inputType2);

    cogroup.setFirstInput(keyedInput1);
    cogroup.setSecondInput(input2);

    return cogroup;
}

From source file:uk.ac.ebi.mdk.domain.matrix.AbstractReactionMatrix.java

public T[] getRow(M m) {
    if (!moleculeMap.containsKey(m)) {
        throw new InvalidParameterException("Molecule not found");
    }/* w w w .java  2  s . c om*/
    return getRow(this.moleculeMap.get(m));
}

From source file:be.fedict.trust.ocsp.OcspTrustLinker.java

private URI toURI(String str) {
    try {/*from   ww  w . j  a va 2  s. c o  m*/
        URI uri = new URI(str);
        return uri;
    } catch (URISyntaxException e) {
        throw new InvalidParameterException("URI syntax error: " + e.getMessage());
    }
}

From source file:com.codetroopers.betterpickers.calendardatepicker.MonthView.java

/**
 * Sets all the parameters for displaying this week. The only required parameter is the week number. Other
 * parameters have a default value and will only update if a new value is included, except for focus month, which
 * will always default to no focus month if no value is passed in. See {@link #VIEW_PARAMS_HEIGHT} for more info on
 * parameters.//from  w ww  .j ava2 s.  c o  m
 *
 * @param params A map of the new parameters, see {@link #VIEW_PARAMS_HEIGHT}
 */
public void setMonthParams(HashMap<String, Integer> params) {
    if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
        throw new InvalidParameterException("You must specify month and year for this view");
    }
    setTag(params);
    // We keep the current value for any params not present
    if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
        mRowHeight = params.get(VIEW_PARAMS_HEIGHT);
        if (mRowHeight < MIN_HEIGHT) {
            mRowHeight = MIN_HEIGHT;
        }
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
        mSelectedDay = params.get(VIEW_PARAMS_SELECTED_DAY);
    }
    if (params.containsKey(VIEW_PARAMS_RANGE_MIN)) {
        mRangeMin = params.get(VIEW_PARAMS_RANGE_MIN);
    }
    if (params.containsKey(VIEW_PARAMS_RANGE_MAX)) {
        mRangeMax = params.get(VIEW_PARAMS_RANGE_MAX);
    }

    // Allocate space for caching the day numbers and focus values
    mMonth = params.get(VIEW_PARAMS_MONTH);
    mYear = params.get(VIEW_PARAMS_YEAR);

    // Figure out what day today is
    final Time today = new Time(Time.getCurrentTimezone());
    today.setToNow();
    mHasToday = false;
    mToday = -1;

    mCalendar.set(Calendar.MONTH, mMonth);
    mCalendar.set(Calendar.YEAR, mYear);
    mCalendar.set(Calendar.DAY_OF_MONTH, 1);
    mDayOfWeekStart = mCalendar.get(Calendar.DAY_OF_WEEK);

    if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
        mWeekStart = params.get(VIEW_PARAMS_WEEK_START);
    } else {
        mWeekStart = mCalendar.getFirstDayOfWeek();
    }

    mNumCells = Utils.getDaysInMonth(mMonth, mYear);
    for (int i = 0; i < mNumCells; i++) {
        final int day = i + 1;
        if (sameDay(day, today)) {
            mHasToday = true;
            mToday = day;
        }
    }
    mNumRows = calculateNumRows();

    // Invalidate cached accessibility information.
    mTouchHelper.invalidateRoot();
}