User:Nswdwkpda/vector.js

package com.annotation;

import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;

@Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE,ElementType.METHOD,        ElementType.CONSTRUCTOR,ElementType.ANNOTATION_TYPE,         ElementType.PACKAGE,ElementType.FIELD,ElementType.LOCAL_VARIABLE}) @Inherited

public @interface Unfinished { public enum Priority { LOW, MEDIUM, HIGH } String value; String[] changedBy default ""; String[] lastChangedBy default ""; Priority priority default Priority.MEDIUM; String createdBy default "James Gosling"; String lastChanged default "2011-07-08"; } package com.annotation;

public @interface UnderConstruction { String owner default "Patrick Naughton"; String value default "Object is Under Construction."; String createdBy default "Mike Sheridan"; String lastChanged default "2011-07-08"; } package com.validators;

import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException;

import com.annotation.UnderConstruction; import com.annotation.Unfinished; import com.annotation.Unfinished.Priority; import com.util.Util;

@UnderConstruction(owner="Jon Doe") public class DateValidator implements Validator { public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { String date = (String) value; String errorLabel = "Please enter a valid date."; if (!component.getAttributes.isEmpty) { errorLabel = (String) component.getAttributes.get("errordisplayval"); }

if (!Util.validateAGivenDate(date)) { @Unfinished(changedBy = "Steve",               value = "whether to add message to context or not, confirm",                priority = Priority.HIGH            ) FacesMessage message = new FacesMessage; message.setSeverity(FacesMessage.SEVERITY_ERROR); message.setSummary(errorLabel); message.setDetail(errorLabel); throw new ValidatorException(message); }   } }