/** * Access the time of last modificaiton. * * @return The Time of last modification. */ public Time getTimeLastModified() { try { return m_properties.getTimeProperty(ResourceProperties.PROP_MODIFIED_DATE); } catch (EntityPropertyNotDefinedException e) { M_log.warn(":getTimeLastModified() no time property defined " + e.getMessage()); } catch (EntityPropertyTypeException e) { M_log.warn(":getTimeLastModified() no time property defined " + e.getMessage()); } return null; }
/** * Access a named property as a long. * * @param name * The property name. * @return the property value. * @exception EmptyException * if not found. * @exception TypeException * if the property is found but not a long. */ public long getLongProperty(String name) throws EntityPropertyNotDefinedException, EntityPropertyTypeException { String p = getProperty(name); if (p == null) throw new EntityPropertyNotDefinedException(); try { return Long.parseLong(p); } catch (Exception any) { throw new EntityPropertyTypeException(name); } }
/** * Access the time that this object was created. * * @return The Time object representing the time of creation. */ public Time getTimeCreated() { try { return m_properties.getTimeProperty(ResourceProperties.PROP_CREATION_DATE); } catch (EntityPropertyNotDefinedException e) { M_log.warn(":getTimeCreated() no time property defined " + e.getMessage()); } catch (EntityPropertyTypeException e) { M_log.warn(":getTimeCreated() no time property defined " + e.getMessage()); } return null; }
/** * Access a named property as a boolean. * * @param name * The property name. * @return the property value. * @exception EmptyException * if not found. * @exception TypeException * if the property is found but not a boolean. */ public boolean getBooleanProperty(String name) throws EntityPropertyNotDefinedException, EntityPropertyTypeException { String p = getProperty(name); if (p == null) throw new EntityPropertyNotDefinedException(); try { return Boolean.valueOf(p).booleanValue(); } catch (Exception any) { throw new EntityPropertyTypeException(name); } }
@Override public boolean assignmentUsesAnonymousGrading(Assignment a) { ResourceProperties properties = a.getProperties(); try { return properties.getBooleanProperty(NEW_ASSIGNMENT_CHECK_ANONYMOUS_GRADING); } catch (EntityPropertyNotDefinedException e) { M_log.debug("Entity Property " + NEW_ASSIGNMENT_CHECK_ANONYMOUS_GRADING + " not defined " + e.getMessage()); } catch (EntityPropertyTypeException e) { M_log.debug("Entity Property " + NEW_ASSIGNMENT_CHECK_ANONYMOUS_GRADING + " type not defined " + e.getMessage()); } return false; }
/** * Access a named property as a Time. * * @param name * The property name. * @return the property value * @exception EmptyException * if not found. * @exception TypeException * if the property is found but not a Time. */ public Time getTimeProperty(String name) throws EntityPropertyNotDefinedException, EntityPropertyTypeException { String p = getProperty(name); if (p == null) throw new EntityPropertyNotDefinedException(); try { return TimeService.newTimeGmt(p); } catch (Exception any) { throw new EntityPropertyTypeException(name); } } // getTimeProperty
+ ignore.getMessage(), ignore);
/** * Access a named property as a User. * * @param name * The property name. * @return the property value * @exception EmptyException * if not found. * @exception TypeException * if the property is found but not a User. */ public User getUserProperty(String name) throws EntityPropertyNotDefinedException, EntityPropertyTypeException { String p = getProperty(name); if (p == null) throw new EntityPropertyNotDefinedException(); try { return UserDirectoryService.getUser(p); } catch (Exception any) { throw new EntityPropertyTypeException(name); } }