org.kuali.student.common.assembly.data
Class MetadataInterrogator

java.lang.Object
  extended by org.kuali.student.common.assembly.data.MetadataInterrogator

public class MetadataInterrogator
extends Object

Author:
nwright

Nested Class Summary
static class MetadataInterrogator.ConstraintIds
           
 
Field Summary
private  Metadata meta
           
 
Constructor Summary
MetadataInterrogator(Metadata meta)
           
 
Method Summary
private static boolean containsConstraint(List<ConstraintMetadata> constraints, String id)
           
 Integer getLargestMinLength()
          get the largest min occurs value
static Integer getLargestMinLength(Metadata meta)
          get the largest min occurs value
 Integer getLargestMinOccurs()
          get the largest min occurs value
static Integer getLargestMinOccurs(Metadata meta)
          get the largest min occurs value
static Long getLargestMinValue(Metadata meta)
           
static Date getLargestMinValueDate(Metadata meta, DateParser parser, Object dataValue)
           
static Double getLargestMinValueDouble(Metadata meta)
           
static String getNextState(Metadata meta)
          Use to determine if the field is required for the next state.
 Integer getSmallestMaxLength()
           
static Integer getSmallestMaxLength(Metadata meta)
           
 Integer getSmallestMaxOccurs()
          checks if this field is a repeating field
static Integer getSmallestMaxOccurs(Metadata meta)
          Returns the smallest max occurs
static Long getSmallestMaxValue(Metadata meta)
           
static Date getSmallestMaxValueDate(Metadata meta, DateParser parser, Object dataValue)
           
static Double getSmallestMaxValueDouble(Metadata meta)
           
static boolean hasConstraint(Metadata meta, MetadataInterrogator.ConstraintIds id)
          Returns true if the metadata contains the specified constraint
static boolean hasConstraint(Metadata meta, String id)
          Returns true if the metadata contains the specified constraint
 boolean hasConstraint(String id)
          Returns true if the metadata contains the specified constraint
private static boolean hasRepeatingConstraint(Metadata meta)
           
 boolean isMultilined()
           
static boolean isMultilined(Metadata meta)
           
 boolean isRepeating()
          checks if this field is a repeating field
static boolean isRepeating(Metadata meta)
          checks if this field is a repeating field
 boolean isRequired()
          checks if is required
static boolean isRequired(Metadata meta)
          checks if is required
static boolean isRequiredForNextState(Metadata meta)
          Use to determine if the field is required for the next state.
private static Date tryParseDate(String s, DateParser parser)
           
private static Double tryParseDouble(String s)
           
private static Long tryParseLong(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

meta

private Metadata meta
Constructor Detail

MetadataInterrogator

public MetadataInterrogator(Metadata meta)
Method Detail

hasConstraint

public boolean hasConstraint(String id)
Returns true if the metadata contains the specified constraint


isRequired

public boolean isRequired()
checks if is required

Returns:
true if any minOccurs > 1

getLargestMinOccurs

public Integer getLargestMinOccurs()
get the largest min occurs value

Returns:
null if none specified

isRepeating

public boolean isRepeating()
checks if this field is a repeating field

Returns:
true if the smallest maxOccurs is > 1

getSmallestMaxOccurs

public Integer getSmallestMaxOccurs()
checks if this field is a repeating field

Returns:
true if the smallest maxOccurs is > 1

getLargestMinLength

public Integer getLargestMinLength()
get the largest min occurs value

Returns:
null if none specified

getSmallestMaxLength

public Integer getSmallestMaxLength()

isMultilined

public boolean isMultilined()

hasConstraint

public static boolean hasConstraint(Metadata meta,
                                    MetadataInterrogator.ConstraintIds id)
Returns true if the metadata contains the specified constraint


hasConstraint

public static boolean hasConstraint(Metadata meta,
                                    String id)
Returns true if the metadata contains the specified constraint


containsConstraint

private static boolean containsConstraint(List<ConstraintMetadata> constraints,
                                          String id)

isRequired

public static boolean isRequired(Metadata meta)
checks if is required

Returns:
true if any minOccurs > 1

isRequiredForNextState

public static boolean isRequiredForNextState(Metadata meta)
Use to determine if the field is required for the next state.

Parameters:
meta -
Returns:

getNextState

public static String getNextState(Metadata meta)
Use to determine if the field is required for the next state.

Parameters:
meta -
Returns:

getLargestMinOccurs

public static Integer getLargestMinOccurs(Metadata meta)
get the largest min occurs value

Returns:
null if none specified

isRepeating

public static boolean isRepeating(Metadata meta)
checks if this field is a repeating field

Returns:
true if the smallest maxOccurs is > 1

hasRepeatingConstraint

private static boolean hasRepeatingConstraint(Metadata meta)

getSmallestMaxOccurs

public static Integer getSmallestMaxOccurs(Metadata meta)
Returns the smallest max occurs

Returns:
Returns the smallest of all maxOccurs, if maxOccurs defined in constraints. Returns -1, indicating unbounded repeating field, if repeating constraint defined & maxOccurs not defined. Returns null, indicating that this is a non-repeating field.

getLargestMinLength

public static Integer getLargestMinLength(Metadata meta)
get the largest min occurs value

Returns:
null if none specified

getSmallestMaxLength

public static Integer getSmallestMaxLength(Metadata meta)

isMultilined

public static boolean isMultilined(Metadata meta)

getLargestMinValue

public static Long getLargestMinValue(Metadata meta)

getSmallestMaxValue

public static Long getSmallestMaxValue(Metadata meta)

getLargestMinValueDouble

public static Double getLargestMinValueDouble(Metadata meta)

getSmallestMaxValueDouble

public static Double getSmallestMaxValueDouble(Metadata meta)

getLargestMinValueDate

public static Date getLargestMinValueDate(Metadata meta,
                                          DateParser parser,
                                          Object dataValue)

getSmallestMaxValueDate

public static Date getSmallestMaxValueDate(Metadata meta,
                                           DateParser parser,
                                           Object dataValue)

tryParseLong

private static Long tryParseLong(String s)

tryParseDouble

private static Double tryParseDouble(String s)

tryParseDate

private static Date tryParseDate(String s,
                                 DateParser parser)


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.