本文整理了Java中net.fortuna.ical4j.validate.ValidationException
类的一些代码示例,展示了ValidationException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ValidationException
类的具体详情如下:
包路径:net.fortuna.ical4j.validate.ValidationException
类名称:ValidationException
[英]$Id$ [23-Apr-2004] An exception thrown during validation.
[中]$Id$[23-Apr-2004]验证期间引发异常。
代码示例来源:origin: ical4j/ical4j
/**
* Ensure a property doesn't occur in the specified list.
* @param propertyName the name of a property
* @param properties a list of properties
* @throws ValidationException thrown when the specified property
* is found in the list of properties
*/
public void assertNone(final String propertyName, final PropertyList properties) throws ValidationException {
if (properties.getProperty(propertyName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {propertyName});
}
}
代码示例来源:origin: stackoverflow.com
@Stateless
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class ExampleRepositoryDelegate {
@EJB
private ExampleRepository repository;
public void add(MyEntity me) {
try {
repository.add(me);
} catch (ValidationException e) {
e.printStackTrace();
}
}
}
代码示例来源:origin: ical4j/ical4j
/**
* @param componentName a component name used in the assertion
* @param components a list of components
* @throws ValidationException where the assertion fails
*/
public static void assertNone(String componentName, ComponentList> components) throws ValidationException {
if (components.getComponent(componentName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {componentName});
}
}
代码示例来源:origin: stackoverflow.com
private void saveAddressBook(String fullName) {
try {
PrintWriter out = new PrintWriter("filename.txt");
out.println(fullName);
out.close();
} catch(ValidationException e) {
e.printStackTrace();
}
}
代码示例来源:origin: org.bedework.ical4j/ical4j
/**
* Ensure a property doesn't occur in the specified list.
* @param propertyName the name of a property
* @param properties a list of properties
* @throws ValidationException thrown when the specified property
* is found in the list of properties
*/
public void assertNone(final String propertyName, final PropertyList properties) throws ValidationException {
if (properties.getProperty(propertyName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {propertyName});
}
}
代码示例来源:origin: ical4j/ical4j
/**
*
*/
public final void testValidationException() {
try {
property.validate();
fail("Should throw ValidationException");
}
catch (ValidationException e) {
e.printStackTrace();
}
}
代码示例来源:origin: org.mnode.ical4j/ical4j
/**
* Ensure a parameter doesn't occur in the specified list.
* @param paramName the name of a parameter
* @param parameters a list of parameters
* @throws ValidationException thrown when the specified property
* is found in the list of properties
*/
public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException {
if (parameters.getParameter(paramName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {paramName});
}
}
代码示例来源:origin: ical4j/ical4j
@Test
public void shouldCorrectCalendarBody() throws IOException, ParserException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException {
String[] calendarNames = { "yahoo1.txt", "yahoo2.txt", "outlook1.txt", "outlook2.txt", "apple.txt" };
for (String calendarName : calendarNames) {
Calendar calendar = buildCalendar(calendarName);
calendar = transformer.transform(calendar);
try {
calendar.validate();
} catch (ValidationException e) {
e.printStackTrace();
fail("Validation failed for " + calendarName);
}
}
}
代码示例来源:origin: org.mnode.ical4j/ical4j
/**
* Ensure a property doesn't occur in the specified list.
* @param propertyName the name of a property
* @param properties a list of properties
* @throws ValidationException thrown when the specified property
* is found in the list of properties
*/
public void assertNone(final String propertyName, final PropertyList properties) throws ValidationException {
if (properties.getProperty(propertyName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {propertyName});
}
}
代码示例来源:origin: net.oneandone.ical4j/ical4j
/**
* @param componentName a component name used in the assertion
* @param components a list of components
* @throws ValidationException where the assertion fails
*/
public static void assertNone(String componentName, ComponentList> components) throws ValidationException {
if (components.getComponent(componentName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {componentName});
}
}
代码示例来源:origin: ical4j/ical4j
/**
* Ensure a parameter doesn't occur in the specified list.
* @param paramName the name of a parameter
* @param parameters a list of parameters
* @throws ValidationException thrown when the specified property
* is found in the list of properties
*/
public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException {
if (parameters.getParameter(paramName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {paramName});
}
}
代码示例来源:origin: org.bedework.ical4j/ical4j
/**
* Ensure a parameter doesn't occur in the specified list.
* @param paramName the name of a parameter
* @param parameters a list of parameters
* @throws ValidationException thrown when the specified property
* is found in the list of properties
*/
public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException {
if (parameters.getParameter(paramName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {paramName});
}
}
代码示例来源:origin: org.bedework.ical4j/ical4j
/**
* @param componentName a component name used in the assertion
* @param components a list of components
* @throws ValidationException where the assertion fails
*/
public static void assertNone(String componentName, ComponentList> components) throws ValidationException {
if (components.getComponent(componentName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {componentName});
}
}
代码示例来源:origin: ical4j/ical4j
/**
* {@inheritDoc}
*/
public final void validate() throws ValidationException {
if (percentage <0 || percentage > 100) {
throw new ValidationException(getName() + " with invalid value: " + percentage);
}
}
代码示例来源:origin: org.mnode.ical4j/ical4j
/**
* {@inheritDoc}
*/
public final void validate() throws ValidationException {
if (percentage <0 || percentage > 100) {
throw new ValidationException(getName() + " with invalid value: " + percentage);
}
}
代码示例来源:origin: ical4j/ical4j
public void validate() throws ValidationException {
throw new ValidationException();
}
};
代码示例来源:origin: org.bedework.ical4j/ical4j
/**
* {@inheritDoc}
*/
public final void validate() throws ValidationException {
if (percentage <0 || percentage > 100) {
throw new ValidationException(getName() + " with invalid value: " + percentage);
}
}
代码示例来源:origin: org.bedework/bw-ical4j-vcard
/**
* @throws ValidationException where the parameter list is not empty
*/
protected final void assertParametersEmpty() throws ValidationException {
if (!getParameters().isEmpty()) {
throw new ValidationException("No parameters allowed for property: " + id);
}
}
代码示例来源:origin: org.mnode.ical4j/ical4j-vcard
/**
* @param propertyId
* @throws ValidationException
*/
private void assertOne(final Property.Id propertyId) throws ValidationException {
final List
if (properties.size() != 1) {
throw new ValidationException("Property [" + propertyId + "] must be specified once");
}
}
代码示例来源:origin: org.mnode.ical4j/ical4j-vcard
/**
* @throws ValidationException where the parameter list is not empty
*/
protected final void assertParametersEmpty() throws ValidationException {
if (!getParameters().isEmpty()) {
throw new ValidationException("No parameters allowed for property: " + id);
}
}