java.util.UnknownFormatFlagsException Java Examples

The following examples show how to use java.util.UnknownFormatFlagsException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Flags.java    From bazel with Apache License 2.0 6 votes vote down vote up
private static Flags parse(char c) {
	switch (c) {
	case '-':
		return LEFT_JUSTIFY;
	case '#':
		return ALTERNATE;
	case '+':
		return PLUS;
	case ' ':
		return LEADING_SPACE;
	case '0':
		return ZERO_PAD;
	case ',':
		return GROUP;
	case '(':
		return PARENTHESES;
	case '<':
		return PREVIOUS;
	default:
		throw new UnknownFormatFlagsException(String.valueOf(c));
	}
}
 
Example #2
Source File: OrientationStateVerticalLeft.java    From LoopBar with MIT License 5 votes vote down vote up
@Override
protected ISelectionGravityState retrieveGravityState(int gravityAttribute) {
    switch (gravityAttribute) {
        case LoopBarView.SELECTION_GRAVITY_START:
            return new TopGravityState();
        case LoopBarView.SELECTION_GRAVITY_END:
            return new BottomGravityState();
        default:
            throw new UnknownFormatFlagsException("unknown gravity Attribute = " + gravityAttribute + ". Should be one of SELECTION_GRAVITY");
    }
}
 
Example #3
Source File: OrientationStateHorizontalBottom.java    From LoopBar with MIT License 5 votes vote down vote up
@Override
protected ISelectionGravityState retrieveGravityState(int gravityAttribute) {
    switch (gravityAttribute) {
        case LoopBarView.SELECTION_GRAVITY_START:
            return new StartGravityState();
        case LoopBarView.SELECTION_GRAVITY_END:
            return new EndGravityState();
        default:
            throw new UnknownFormatFlagsException("unknown gravity Attribute = " + gravityAttribute + ". Should be one of SELECTION_GRAVITY");
    }
}
 
Example #4
Source File: UnknownFormatFlagsExceptionTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * java.util.UnknownFormatFlagsException#UnknownFormatFlagsException(String)
 */
public void test_unknownFormatFlagsException() {

    try {
        new UnknownFormatFlagsException(null);
        fail("should throw NullPointerExcepiton");
    } catch (NullPointerException e) {
        // expected
    }
}
 
Example #5
Source File: UnknownFormatFlagsExceptionTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * java.util.UnknownFormatFlagsException#getFlags()
 */
public void test_getFlags() {
    String s = "MYTESTSTRING";
    UnknownFormatFlagsException UnknownFormatFlagsException = new UnknownFormatFlagsException(
            s);
    assertEquals(s, UnknownFormatFlagsException.getFlags());
}
 
Example #6
Source File: UnknownFormatFlagsExceptionTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * java.util.UnknownFormatFlagsException#getMessage()
 */
public void test_getMessage() {
    String s = "MYTESTSTRING";
    UnknownFormatFlagsException UnknownFormatFlagsException = new UnknownFormatFlagsException(
            s);
    assertNotNull(UnknownFormatFlagsException.getMessage());
}
 
Example #7
Source File: UnknownFormatFlagsExceptionTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public void assertDeserialized(Serializable initial,
        Serializable deserialized) {

    SerializationTest.THROWABLE_COMPARATOR.assertDeserialized(initial,
            deserialized);

    UnknownFormatFlagsException initEx = (UnknownFormatFlagsException) initial;
    UnknownFormatFlagsException desrEx = (UnknownFormatFlagsException) deserialized;

    assertEquals("Flags", initEx.getFlags(), desrEx.getFlags());
}
 
Example #8
Source File: UnknownFormatFlagsExceptionTest.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * serialization/deserialization.
 */
public void testSerializationSelf() throws Exception {

    SerializationTest.verifySelf(new UnknownFormatFlagsException(
            "MYTESTSTRING"), exComparator);
}
 
Example #9
Source File: UnknownFormatFlagsExceptionTest.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * serialization/deserialization compatibility with RI.
 */
public void testSerializationCompatibility() throws Exception {

    SerializationTest.verifyGolden(this, new UnknownFormatFlagsException(
            "MYTESTSTRING"), exComparator);
}