http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarFilter.java deleted file mode 100755 index af88d87..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarFilter.java +++ /dev/null @@ -1,289 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.text.*; -import java.util.*; - -import javax.xml.bind.*; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.filter.*; -import com.ibm.juno.core.parser.ParseException; -import com.ibm.juno.core.utils.*; - -/** - * Transforms {@link Calendar Calendars} to {@link String Strings}. - * - * - * <h6 class='topic'>Behavior-specific subclasses</h6> - * <p> - * The following direct subclasses are provided for convenience: - * <ul> - * <li>{@link ToString} - Transforms to {@link String Strings} using the {@code Date.toString()} method. - * <li>{@link ISO8601DT} - Transforms to ISO8601 date-time strings. - * <li>{@link ISO8601DTZ} - Same as {@link ISO8601DT}, except always serializes in GMT. - * <li>{@link RFC2822DT} - Transforms to RFC2822 date-time strings. - * <li>{@link RFC2822DTZ} - Same as {@link RFC2822DT}, except always serializes in GMT. - * <li>{@link RFC2822D} - Transforms to RFC2822 date strings. - * <li>{@link Simple} - Transforms to simple <js>"yyyy/MM/dd HH:mm:ss"</js> strings. - * <li>{@link Medium} - Transforms to {@link DateFormat#MEDIUM} strings. - * </ul> - * - * - * @author James Bognar ([email protected]) - */ -public class CalendarFilter extends PojoFilter<Calendar,String> { - - private static final TimeZone GMT = TimeZone.getTimeZone("GMT"); - - /** - * Transforms {@link Calendar Calendars} to {@link String Strings} using the {@code Date.toString()} method. - * - * <dl> - * <dt>Example output:</dt> - * <dd> - * <ul> - * <li><js>"Wed Jul 04 15:30:45 EST 2001"</js> - * </ul> - * </dd> - * </dl> - */ - public static class ToString extends CalendarFilter { - /** Constructor */ - public ToString() { - super("EEE MMM dd HH:mm:ss zzz yyyy"); - } - } - - /** - * Transforms {@link Calendar Calendars} to ISO8601 date-time strings. - * - * <dl> - * <dt>Example output:</dt> - * <dd> - * <ul> - * <li><js>"2001-07-04T15:30:45-05:00"</js> - * <li><js>"2001-07-04T15:30:45Z"</js> - * </ul> - * </dd> - * <dt>Example input:</dt> - * <dd> - * <ul> - * <li><js>"2001-07-04T15:30:45-05:00"</js> - * <li><js>"2001-07-04T15:30:45Z"</js> - * <li><js>"2001-07-04T15:30:45.1Z"</js> - * <li><js>"2001-07-04T15:30Z"</js> - * <li><js>"2001-07-04"</js> - * <li><js>"2001-07"</js> - * <li><js>"2001"</js> - * </ul> - * </dd> - * </dl> - */ - public static class ISO8601DT extends CalendarFilter { - - /** Constructor */ - public ISO8601DT() {} - - @Override /* PojoFilter */ - public Calendar unfilter(String o, ClassMeta<?> hint) throws ParseException { - try { - if (StringUtils.isEmpty(o)) - return null; - return convert(DatatypeConverter.parseDateTime(o), hint); - } catch (Exception e) { - throw new ParseException(e); - } - } - - @Override /* PojoFilter */ - public String filter(Calendar o) { - return DatatypeConverter.printDateTime(o); - } - } - - /** - * Same as {@link ISO8601DT}, except always serializes in GMT. - * <p> - * Example output: <js>"2001-07-04T15:30:45Z"</js> - */ - public static class ISO8601DTZ extends CalendarFilter { - - /** Constructor */ - public ISO8601DTZ() {} - - @Override /* PojoFilter */ - public Calendar unfilter(String o, ClassMeta<?> hint) throws ParseException { - try { - if (StringUtils.isEmpty(o)) - return null; - return convert(DatatypeConverter.parseDateTime(o), hint); - } catch (Exception e) { - throw new ParseException(e); - } - } - - @Override /* PojoFilter */ - public String filter(Calendar o) { - if (o.getTimeZone().getRawOffset() != 0) { - Calendar c = Calendar.getInstance(GMT); - c.setTime(o.getTime()); - o = c; - } - return DatatypeConverter.printDateTime(o); - } - } - - /** - * Transforms {@link Calendar Calendars} to RFC2822 date-time strings. - */ - public static class RFC2822DT extends CalendarFilter { - /** Constructor */ - public RFC2822DT() { - super("EEE, dd MMM yyyy HH:mm:ss Z"); - } - } - - /** - * Same as {@link RFC2822DT}, except always serializes in GMT. - * <p> - * Example output: <js>"Wed, 31 Jan 2001 12:34:56 +0000"</js> - */ - public static class RFC2822DTZ extends CalendarFilter { - /** Constructor */ - public RFC2822DTZ() { - super("EEE, dd MMM yyyy HH:mm:ss 'GMT'", GMT); - } - } - - /** - * Transforms {@link Calendar Calendars} to RFC2822 date strings. - */ - public static class RFC2822D extends CalendarFilter { - /** Constructor */ - public RFC2822D() { - super("dd MMM yyyy"); - } - } - - /** - * Transforms {@link Calendar Calendars} to simple <js>"yyyy/MM/dd HH:mm:ss"</js> strings. - */ - public static class Simple extends CalendarFilter { - /** Constructor */ - public Simple() { - super("yyyy/MM/dd HH:mm:ss"); - } - } - - /** - * Transforms {@link Calendar Calendars} to {@link DateFormat#MEDIUM} strings. - */ - public static class Medium extends CalendarFilter { - /** Constructor */ - public Medium() { - super(DateFormat.getDateInstance(DateFormat.MEDIUM)); - } - } - - /** The formatter to convert dates to Strings. */ - private DateFormat format; - - private TimeZone timeZone; - - /** - * Default constructor. - * <p> - * This constructor is used when <code>filter()</code> and <code>unfilter()</code> are overridden by subclasses. - */ - public CalendarFilter() {} - - /** - * Construct a filter using the specified date format string that will be - * used to construct a {@link SimpleDateFormat} that will be used to convert - * dates to strings. - * - * @param simpleDateFormat The {@link SimpleDateFormat} pattern. - */ - public CalendarFilter(String simpleDateFormat) { - this(new SimpleDateFormat(simpleDateFormat)); - } - - /** - * Construct a filter using the specified date format string that will be - * used to construct a {@link SimpleDateFormat} that will be used to convert - * dates to strings. - * - * @param simpleDateFormat The {@link SimpleDateFormat} pattern. - * @param timeZone The time zone to associate with the date pattern. - */ - public CalendarFilter(String simpleDateFormat, TimeZone timeZone) { - this(new SimpleDateFormat(simpleDateFormat)); - format.setTimeZone(timeZone); - this.timeZone = timeZone; - } - - /** - * Construct a filter using the specified {@link DateFormat} that will be used to convert - * dates to strings. - * - * @param format The format to use to convert dates to strings. - */ - public CalendarFilter(DateFormat format) { - super(); - this.format = format; - } - - /** - * Converts the specified {@link Calendar} to a {@link String}. - */ - @Override /* PojoFilter */ - public String filter(Calendar o) { - DateFormat df = format; - TimeZone tz1 = o.getTimeZone(); - TimeZone tz2 = format.getTimeZone(); - if (timeZone == null && ! tz1.equals(tz2)) { - df = (DateFormat)format.clone(); - df.setTimeZone(tz1); - } - return df.format(o.getTime()); - } - - /** - * Converts the specified {@link String} to a {@link Calendar}. - */ - @Override /* PojoFilter */ - public Calendar unfilter(String o, ClassMeta<?> hint) throws ParseException { - try { - if (StringUtils.isEmpty(o)) - return null; - return convert(format.parse(o), hint); - } catch (Exception e) { - throw new ParseException(e); - } - } - - private static Calendar convert(Calendar in, ClassMeta<?> hint) throws Exception { - if (hint.isInstance(in) || ! hint.canCreateNewInstance()) - return in; - Calendar c = (Calendar)hint.newInstance(); - c.setTime(in.getTime()); - c.setTimeZone(in.getTimeZone()); - return c; - } - - private static Calendar convert(Date in, ClassMeta<?> hint) throws Exception { - if (hint == null || ! hint.canCreateNewInstance()) - hint = BeanContext.DEFAULT.getClassMeta(GregorianCalendar.class); - Calendar c = (Calendar)hint.newInstance(); - c.setTime(in); - return c; - } -}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarLongFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarLongFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarLongFilter.class deleted file mode 100755 index 98d2415..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarLongFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarLongFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarLongFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarLongFilter.java deleted file mode 100755 index c68b3c9..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarLongFilter.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.util.*; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.filter.*; -import com.ibm.juno.core.parser.*; - -/** - * Transforms {@link Calendar Calendars} to {@link Long Longs} using {@code Calender.getTime().getTime()}. - * <p> - * TODO: This class does not handle timezones correctly when parsing {@code GregorianCalendar} objects. - * - * @author James Bognar ([email protected]) - */ -public class CalendarLongFilter extends PojoFilter<Calendar,Long> { - - /** - * Converts the specified {@link Calendar} to a {@link Long}. - */ - @Override /* PojoFilter */ - public Long filter(Calendar o) { - return o.getTime().getTime(); - } - - /** - * Converts the specified {@link Long} to a {@link Calendar}. - */ - @Override /* PojoFilter */ - @SuppressWarnings("unchecked") - public Calendar unfilter(Long o, ClassMeta<?> hint) throws ParseException { - ClassMeta<? extends Calendar> tt; - try { - if (hint == null || ! hint.canCreateNewInstance()) - hint = getBeanContext().getClassMeta(GregorianCalendar.class); - tt = (ClassMeta<? extends Calendar>)hint; - Calendar c = tt.newInstance(); - c.setTimeInMillis(o); - return c; - } catch (Exception e) { - throw new ParseException(e); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarMapFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarMapFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarMapFilter.class deleted file mode 100755 index bf9f7fd..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarMapFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarMapFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarMapFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarMapFilter.java deleted file mode 100755 index 9c4ab3f..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/CalendarMapFilter.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.util.*; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.filter.*; -import com.ibm.juno.core.parser.*; - -/** - * Transforms {@link Calendar Calendars} to {@link Map Maps} of the format <code>{_class:String,value:long}</code>. - * <p> - * TODO: This class does not handle timezones correctly when parsing {@code GregorianCalendar} objects. - * - * @author James Bognar ([email protected]) - */ -@SuppressWarnings("rawtypes") -public class CalendarMapFilter extends PojoFilter<Calendar,Map> { - - /** - * Converts the specified {@link Calendar} to a {@link Map}. - */ - @Override /* PojoFilter */ - public Map filter(Calendar o) { - ObjectMap m = new ObjectMap(); - m.put("time", o.getTime().getTime()); - m.put("timeZone", o.getTimeZone().getID()); - return m; - } - - /** - * Converts the specified {@link Map} to a {@link Calendar}. - */ - @Override /* PojoFilter */ - @SuppressWarnings("unchecked") - public Calendar unfilter(Map o, ClassMeta<?> hint) throws ParseException { - ClassMeta<? extends Calendar> tt; - try { - if (hint == null || ! hint.canCreateNewInstance()) - hint = getBeanContext().getClassMeta(GregorianCalendar.class); - tt = (ClassMeta<? extends Calendar>)hint; - long time = Long.parseLong(o.get("time").toString()); - String timeZone = o.get("timeZone").toString(); - Date d = new Date(time); - Calendar c = tt.newInstance(); - c.setTime(d); - c.setTimeZone(TimeZone.getTimeZone(timeZone)); - return c; - } catch (Exception e) { - throw new ParseException(e); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DT.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DT.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DT.class deleted file mode 100755 index 19e7cf5..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DT.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTP.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTP.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTP.class deleted file mode 100755 index 5063f59..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTP.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTPNZ.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTPNZ.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTPNZ.class deleted file mode 100755 index 3c4fc61..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTPNZ.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTZ.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTZ.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTZ.class deleted file mode 100755 index 5e26cba..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTZ.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTZP.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTZP.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTZP.class deleted file mode 100755 index d41205f..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ISO8601DTZP.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$Medium.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$Medium.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$Medium.class deleted file mode 100755 index 570a27b..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$Medium.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822D.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822D.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822D.class deleted file mode 100755 index 0c8f4f1..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822D.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822DT.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822DT.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822DT.class deleted file mode 100755 index f034235..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822DT.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822DTZ.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822DTZ.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822DTZ.class deleted file mode 100755 index 41db26c..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$RFC2822DTZ.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$Simple.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$Simple.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$Simple.class deleted file mode 100755 index e438251..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$Simple.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$SimpleP.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$SimpleP.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$SimpleP.class deleted file mode 100755 index be31fe4..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$SimpleP.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ToString.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ToString.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ToString.class deleted file mode 100755 index 7a78e4d..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter$ToString.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter.class deleted file mode 100755 index 123a252..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter.java deleted file mode 100755 index 1759b41..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateFilter.java +++ /dev/null @@ -1,345 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.text.*; -import java.util.*; - -import javax.xml.bind.*; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.filter.*; -import com.ibm.juno.core.parser.ParseException; -import com.ibm.juno.core.utils.*; - -/** - * Transforms {@link Date Dates} to {@link String Strings}. - * - * - * <h6 class='topic'>Behavior-specific subclasses</h6> - * <p> - * The following direct subclasses are provided for convenience: - * <ul> - * <li>{@link ToString} - Transforms to {@link String Strings} using the {@code Date.toString()} method. - * <li>{@link ISO8601DT} - Transforms to ISO8601 date-time strings. - * <li>{@link ISO8601DTP} - Transforms to ISO8601 date-time strings with millisecond precision. - * <li>{@link ISO8601DTZ} - Same as {@link ISO8601DT}, except always serializes in GMT. - * <li>{@link ISO8601DTZ} - Same as {@link ISO8601DTZ}, except with millisecond precision. - * <li>{@link RFC2822DT} - Transforms to RFC2822 date-time strings. - * <li>{@link RFC2822DTZ} - Same as {@link RFC2822DT}, except always serializes in GMT. - * <li>{@link RFC2822D} - Transforms to RFC2822 date strings. - * <li>{@link Simple} - Transforms to simple <js>"yyyy/MM/dd HH:mm:ss"</js> strings. - * <li>{@link Medium} - Transforms to {@link DateFormat#MEDIUM} strings. - * </ul> - * - * - * @author James Bognar ([email protected]) - */ -public class DateFilter extends PojoFilter<Date,String> { - - /** - * Transforms {@link Date Dates} to {@link String Strings} using the {@code Date.toString()} method. - * <p> - * <dl> - * <dt>Example output:</dt> - * <dd> - * <ul> - * <li><js>"Wed Jul 04 15:30:45 EST 2001"</js> - * </ul> - * </dd> - * </dl> - */ - public static class ToString extends DateFilter { - /** Constructor */ - public ToString() { - super("EEE MMM dd HH:mm:ss zzz yyyy"); - } - } - - /** - * Transforms {@link Date Dates} to ISO8601 date-time strings. - * - * <dl> - * <dt>Example output:</dt> - * <dd> - * <ul> - * <li><js>"2001-07-04T15:30:45-05:00"</js> - * <li><js>"2001-07-04T15:30:45Z"</js> - * </ul> - * </dd> - * <dt>Example input:</dt> - * <dd> - * <ul> - * <li><js>"2001-07-04T15:30:45-05:00"</js> - * <li><js>"2001-07-04T15:30:45Z"</js> - * <li><js>"2001-07-04T15:30:45.1Z"</js> - * <li><js>"2001-07-04T15:30Z"</js> - * <li><js>"2001-07-04"</js> - * <li><js>"2001-07"</js> - * <li><js>"2001"</js> - * </ul> - * </dd> - * </dl> - */ - public static class ISO8601DT extends DateFilter { - private SimpleDateFormat tzFormat = new SimpleDateFormat("Z"); - - /** Constructor */ - public ISO8601DT() { - this("yyyy-MM-dd'T'HH:mm:ss"); - } - - /** - * Constructor with specific pattern. - * - * @param pattern The {@link MessageFormat}-style format string. - */ - protected ISO8601DT(String pattern) { - super(pattern); - } - - @Override /* PojoFilter */ - public Date unfilter(String o, ClassMeta<?> hint) throws ParseException { - try { - if (StringUtils.isEmpty(o)) - return null; - return convert(DatatypeConverter.parseDateTime(o).getTime(), hint); - } catch (ParseException e) { - throw e; - } catch (Exception e) { - throw new ParseException(e); - } - } - - @Override /* PojoFilter */ - public String filter(Date o) { - String s = super.filter(o); - String tz = tzFormat.format(o); - if (tz.equals("+0000")) - return s + "Z"; - return s + tz.substring(0,3) + ':' + tz.substring(3); - } - } - - /** - * Same as {@link ISO8601DT} except serializes to millisecond precision. - * <p> - * Example output: <js>"2001-07-04T15:30:45.123-05:00"</js> - */ - public static class ISO8601DTP extends ISO8601DT { - - /** Constructor */ - public ISO8601DTP() { - super("yyyy-MM-dd'T'HH:mm:ss.SSS"); - } - } - - /** - * Same as {@link ISO8601DT} except serializes to millisecond precision and doesn't include timezone. - * <p> - * Example output: <js>"2001-07-04T15:30:45.123"</js> - */ - public static class ISO8601DTPNZ extends DateFilter { - - /** Constructor */ - public ISO8601DTPNZ() { - super("yyyy-MM-dd'T'HH:mm:ss.SSS"); - } - } - - /** - * Same as {@link ISO8601DT}, except always serializes in GMT. - * <p> - * Example output: <js>"2001-07-04T15:30:45Z"</js> - */ - public static class ISO8601DTZ extends DateFilter { - - /** Constructor */ - public ISO8601DTZ() { - this("yyyy-MM-dd'T'HH:mm:ss'Z'"); - } - - /** - * Constructor with specific pattern. - * - * @param pattern The {@link MessageFormat}-style format string. - */ - protected ISO8601DTZ(String pattern) { - super(pattern, "GMT"); - } - - @Override /* PojoFilter */ - public Date unfilter(String o, ClassMeta<?> hint) throws ParseException { - try { - if (StringUtils.isEmpty(o)) - return null; - return convert(DatatypeConverter.parseDateTime(o).getTime(), hint); - } catch (ParseException e) { - throw e; - } catch (Exception e) { - throw new ParseException(e); - } - } - } - - /** - * Same as {@link ISO8601DTZ} except serializes to millisecond precision. - * <p> - * Example output: <js>"2001-07-04T15:30:45.123Z"</js> - */ - public static class ISO8601DTZP extends ISO8601DT { - - /** Constructor */ - public ISO8601DTZP() { - super("yyyy-MM-dd'T'HH:mm:ss.SSS"); - } - } - - /** - * Transforms {@link Date Dates} to RFC2822 date-time strings. - */ - public static class RFC2822DT extends DateFilter { - /** Constructor */ - public RFC2822DT() { - super("EEE, dd MMM yyyy HH:mm:ss z"); - } - } - - /** - * Same as {@link RFC2822DT}, except always serializes in GMT. - * <p> - * Example output: <js>"2001-07-04T15:30:45Z"</js> - */ - public static class RFC2822DTZ extends DateFilter { - /** Constructor */ - public RFC2822DTZ() { - super("EEE, dd MMM yyyy HH:mm:ss z", "GMT"); - } - } - - /** - * Transforms {@link Date Dates} to RFC2822 date strings. - */ - public static class RFC2822D extends DateFilter { - /** Constructor */ - public RFC2822D() { - super("dd MMM yyyy"); - } - } - - /** - * Transforms {@link Date Dates} to simple <js>"yyyy/MM/dd HH:mm:ss"</js> strings. - */ - public static class Simple extends DateFilter { - /** Constructor */ - public Simple() { - super("yyyy/MM/dd HH:mm:ss"); - } - } - - /** - * Transforms {@link Date Dates} to simple <js>"yyyy/MM/dd HH:mm:ss.SSS"</js> strings. - */ - public static class SimpleP extends DateFilter { - /** Constructor */ - public SimpleP() { - super("yyyy/MM/dd HH:mm:ss.SSS"); - } - } - - /** - * Transforms {@link Date Dates} to {@link DateFormat#MEDIUM} strings. - */ - public static class Medium extends DateFilter { - /** Constructor */ - public Medium() { - super(DateFormat.getDateInstance(DateFormat.MEDIUM)); - } - } - - /** The formatter to convert dates to Strings. */ - private DateFormat format; - - /** - * Construct a filter using the specified date format string that will be - * used to construct a {@link SimpleDateFormat} that will be used to convert - * dates to strings. - * - * @param simpleDateFormat The {@link SimpleDateFormat} pattern. - */ - public DateFilter(String simpleDateFormat) { - this(new SimpleDateFormat(simpleDateFormat)); - } - - /** - * Construct a filter using the specified date format string that will be - * used to construct a {@link SimpleDateFormat} that will be used to convert - * dates to strings. - * - * @param simpleDateFormat The {@link SimpleDateFormat} pattern. - * @param timeZone The time zone to associate with the date pattern. - */ - public DateFilter(String simpleDateFormat, String timeZone) { - this(new SimpleDateFormat(simpleDateFormat)); - format.setTimeZone(TimeZone.getTimeZone(timeZone)); - } - - /** - * Construct a filter using the specified {@link DateFormat} that will be used to convert - * dates to strings. - * - * @param format The format to use to convert dates to strings. - */ - public DateFilter(DateFormat format) { - super(); - this.format = format; - } - - /** - * Converts the specified {@link Date} to a {@link String}. - */ - @Override /* PojoFilter */ - public String filter(Date o) { - return format.format(o); - } - - /** - * Converts the specified {@link String} to a {@link Date}. - */ - @Override /* PojoFilter */ - public Date unfilter(String o, ClassMeta<?> hint) throws ParseException { - try { - if (StringUtils.isEmpty(o)) - return null; - Date d = format.parse(o); - return convert(d, hint); - } catch (ParseException e) { - throw e; - } catch (Exception e) { - throw new ParseException(e); - } - } - - private static Date convert(Date in, ClassMeta<?> hint) throws Exception { - if (in == null) - return null; - if (hint == null || hint.isInstance(in)) - return in; - Class<?> c = hint.getInnerClass(); - if (c == java.util.Date.class) - return in; - if (c == java.sql.Date.class) - return new java.sql.Date(in.getTime()); - if (c == java.sql.Time.class) - return new java.sql.Time(in.getTime()); - if (c == java.sql.Timestamp.class) - return new java.sql.Timestamp(in.getTime()); - throw new ParseException("DateFilter is unable to narrow object of type ''{0}''", c); - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateLongFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateLongFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateLongFilter.class deleted file mode 100755 index 70b7348..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateLongFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateLongFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateLongFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateLongFilter.java deleted file mode 100755 index c454645..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateLongFilter.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.util.*; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.filter.*; -import com.ibm.juno.core.parser.*; - -/** - * Transforms {@link Date Dates} to {@link Long Longs}. - * - * @author James Bognar ([email protected]) - */ -public class DateLongFilter extends PojoFilter<Date,Long> { - - /** - * Converts the specified {@link Date} to a {@link Long}. - */ - @Override /* PojoFilter */ - public Long filter(Date o) { - return o.getTime(); - } - - /** - * Converts the specified {@link Long} to a {@link Date}. - */ - @Override /* PojoFilter */ - public Date unfilter(Long o, ClassMeta<?> hint) throws ParseException { - Class<?> c = (hint == null ? java.util.Date.class : hint.getInnerClass()); - if (c == java.util.Date.class) - return new java.util.Date(o); - if (c == java.sql.Date.class) - return new java.sql.Date(o); - if (c == java.sql.Time.class) - return new java.sql.Time(o); - if (c == java.sql.Timestamp.class) - return new java.sql.Timestamp(o); - throw new ParseException("DateLongFilter is unable to narrow object of type ''{0}''", c); - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateMapFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateMapFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateMapFilter.class deleted file mode 100755 index 1a84d40..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateMapFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateMapFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateMapFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateMapFilter.java deleted file mode 100755 index ba5c63f..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/DateMapFilter.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.util.*; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.filter.*; -import com.ibm.juno.core.parser.*; - -/** - * Transforms {@link Date Dates} to {@link Map Maps} of the format <tt>{value:long}</tt>. - * - * @author James Bognar ([email protected]) - */ -@SuppressWarnings("rawtypes") -public class DateMapFilter extends PojoFilter<Date,Map> { - - /** - * Converts the specified {@link Date} to a {@link Map}. - */ - @Override /* PojoFilter */ - public Map filter(Date o) { - ObjectMap m = new ObjectMap(); - m.put("time", o.getTime()); - return m; - } - - /** - * Converts the specified {@link Map} to a {@link Date}. - */ - @Override /* PojoFilter */ - public Date unfilter(Map o, ClassMeta<?> hint) throws ParseException { - Class<?> c = (hint == null ? java.util.Date.class : hint.getInnerClass()); - long l = Long.parseLong(((Map<?,?>)o).get("time").toString()); - if (c == java.util.Date.class) - return new java.util.Date(l); - if (c == java.sql.Date.class) - return new java.sql.Date(l); - if (c == java.sql.Time.class) - return new java.sql.Time(l); - if (c == java.sql.Timestamp.class) - return new java.sql.Timestamp(l); - throw new ParseException("DateMapFilter is unable to narrow object of type ''{0}''", c); - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/EnumerationFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/EnumerationFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/EnumerationFilter.class deleted file mode 100755 index 3aaf8b1..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/EnumerationFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/EnumerationFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/EnumerationFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/EnumerationFilter.java deleted file mode 100755 index 549f7da..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/EnumerationFilter.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2014. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.util.*; - -import com.ibm.juno.core.filter.*; - -/** - * Transforms {@link Enumeration Enumerations} to {@code List<Object>} objects. - * <p> - * This is a one-way filter, since {@code Enumerations} cannot be reconstituted. - * - * @author James Bognar ([email protected]) - */ -@SuppressWarnings({"unchecked","rawtypes"}) -public class EnumerationFilter extends PojoFilter<Enumeration,List> { - - /** - * Converts the specified {@link Enumeration} to a {@link List}. - */ - @Override /* PojoFilter */ - public List filter(Enumeration o) { - List l = new LinkedList(); - while (o.hasMoreElements()) - l.add(o.nextElement()); - return l; - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/IteratorFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/IteratorFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/IteratorFilter.class deleted file mode 100755 index f7ef926..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/IteratorFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/IteratorFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/IteratorFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/IteratorFilter.java deleted file mode 100755 index 7e5ded6..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/IteratorFilter.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2014. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.util.*; - -import com.ibm.juno.core.filter.*; - -/** - * Transforms {@link Iterator Iterators} to {@code List<Object>} objects. - * <p> - * This is a one-way filter, since {@code Iterators} cannot be reconstituted. - * - * @author James Bognar ([email protected]) - */ -@SuppressWarnings({"unchecked","rawtypes"}) -public class IteratorFilter extends PojoFilter<Iterator,List> { - - /** - * Converts the specified {@link Iterator} to a {@link List}. - */ - @Override /* PojoFilter */ - public List filter(Iterator o) { - List l = new LinkedList(); - while (o.hasNext()) - l.add(o.next()); - return l; - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Html.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Html.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Html.class deleted file mode 100755 index 1e70661..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Html.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Json.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Json.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Json.class deleted file mode 100755 index 4a97b6b..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Json.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$PlainText.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$PlainText.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$PlainText.class deleted file mode 100755 index 8e5c6fd..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$PlainText.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Xml.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Xml.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Xml.class deleted file mode 100755 index 21130fc..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter$Xml.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter.class deleted file mode 100755 index c425ae6..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter.java deleted file mode 100755 index e1d4ecc..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/ReaderFilter.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2014. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import java.io.*; - -import com.ibm.juno.core.filter.*; -import com.ibm.juno.core.html.*; -import com.ibm.juno.core.json.*; -import com.ibm.juno.core.parser.*; -import com.ibm.juno.core.serializer.*; -import com.ibm.juno.core.utils.*; -import com.ibm.juno.core.xml.*; - -/** - * Transforms the contents of a {@link Reader} into an {@code Object}. - * - * - * <h6 class='topic'>Description</h6> - * <p> - * The {@code Reader} must contain JSON, Juno-generated XML (output from {@link XmlSerializer}), - * or Juno-generated HTML (output from {@link JsonSerializer}) in order to be parsed correctly. - * <p> - * Useful for serializing models that contain {@code Readers} created by {@code RestCall} instances. - * <p> - * This is a one-way filter, since {@code Readers} cannot be reconstituted. - * - * - * <h6 class='topic'>Behavior-specific subclasses</h6> - * <p> - * The following direct subclasses are provided for convenience: - * <ul> - * <li>{@link Json} - Parses JSON text. - * <li>{@link Xml} - Parses XML text. - * <li>{@link Html} - Parses HTML text. - * <li>{@link PlainText} - Parses plain text. - * </ul> - * - * - * @author James Bognar ([email protected]) - */ -public class ReaderFilter extends PojoFilter<Reader,Object> { - - /** Reader filter for reading JSON text. */ - public static class Json extends ReaderFilter { - /** Constructor */ - public Json() { - super(JsonParser.DEFAULT); - } - } - - /** Reader filter for reading XML text. */ - public static class Xml extends ReaderFilter { - /** Constructor */ - public Xml() { - super(XmlParser.DEFAULT); - } - } - - /** Reader filter for reading HTML text. */ - public static class Html extends ReaderFilter { - /** Constructor */ - public Html() { - super(HtmlParser.DEFAULT); - } - } - - /** Reader filter for reading plain text. */ - public static class PlainText extends ReaderFilter { - /** Constructor */ - public PlainText() { - super(null); - } - } - - /** The parser to use to parse the contents of the Reader. */ - private ReaderParser parser; - - /** - * @param parser The parser to use to convert the contents of the reader to Java objects. - */ - public ReaderFilter(ReaderParser parser) { - this.parser = parser; - } - - /** - * Converts the specified {@link Reader} to an {@link Object} whose type is determined - * by the contents of the reader. - */ - @Override /* PojoFilter */ - public Object filter(Reader o) throws SerializeException { - try { - if (parser == null) - return IOUtils.read(o); - return parser.parse(o, -1, beanContext.object()); - } catch (IOException e) { - return e.getLocalizedMessage(); - } catch (Exception e) { - throw new SerializeException("ReaderFilter could not filter object of type ''{0}''", o == null ? null : o.getClass().getName()).initCause(e); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/XMLGregorianCalendarFilter.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/XMLGregorianCalendarFilter.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/XMLGregorianCalendarFilter.class deleted file mode 100755 index 51e4b5d..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/XMLGregorianCalendarFilter.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/XMLGregorianCalendarFilter.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/XMLGregorianCalendarFilter.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/XMLGregorianCalendarFilter.java deleted file mode 100755 index f2f111f..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/XMLGregorianCalendarFilter.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2013, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.filters; - -import javax.xml.datatype.*; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.filter.*; -import com.ibm.juno.core.parser.*; -import com.ibm.juno.core.serializer.*; -import com.ibm.juno.core.utils.*; - -/** - * Transforms {@link XMLGregorianCalendar XMLGregorianCalendars} to ISO8601 date-time {@link String Strings}. - * <p> - * Objects are converted to strings using {@link XMLGregorianCalendar#toXMLFormat()}. - * <p> - * Strings are converted to objects using {@link DatatypeFactory#newXMLGregorianCalendar(String)}. - * - * @author James Bognar ([email protected]) - */ -public class XMLGregorianCalendarFilter extends PojoFilter<XMLGregorianCalendar,String> { - - private DatatypeFactory dtf; - - /** - * Constructor. - */ - public XMLGregorianCalendarFilter() { - try { - this.dtf = DatatypeFactory.newInstance(); - } catch (DatatypeConfigurationException e) { - throw new RuntimeException(e); - } - } - - /** - * Converts the specified <code>XMLGregorianCalendar</code> to a {@link String}. - */ - @Override /* PojoFilter */ - public String filter(XMLGregorianCalendar b) throws SerializeException { - return b.toXMLFormat(); - } - - /** - * Converts the specified {@link String} to an <code>XMLGregorianCalendar</code>. - */ - @Override /* PojoFilter */ - public XMLGregorianCalendar unfilter(String s, ClassMeta<?> hint) throws ParseException { - if (StringUtils.isEmpty(s)) - return null; - return dtf.newXMLGregorianCalendar(s); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/package.html ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/package.html b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/package.html deleted file mode 100755 index 27e7a14..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/filters/package.html +++ /dev/null @@ -1,59 +0,0 @@ -<!DOCTYPE HTML> -<!-- - Licensed Materials - Property of IBM - (c) Copyright IBM Corporation 2014. All Rights Reserved. - - Note to U.S. Government Users Restricted Rights: - Use, duplication or disclosure restricted by GSA ADP Schedule - Contract with IBM Corp. - --> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <style type="text/css"> - /* For viewing in Page Designer */ - @IMPORT url("../../../../../../javadoc.css"); - - /* For viewing in REST interface */ - @IMPORT url("../htdocs/javadoc.css"); - body { - margin: 20px; - } - </style> - <script> - /* Replace all @code and @link tags. */ - window.onload = function() { - document.body.innerHTML = document.body.innerHTML.replace(/\{\@code ([^\}]+)\}/g, '<code>$1</code>'); - document.body.innerHTML = document.body.innerHTML.replace(/\{\@link (([^\}]+)\.)?([^\.\}]+)\}/g, '<code>$3</code>'); - } - </script> -</head> -<body> -<p>Predefined Filter implementations</p> -<script> - function toggle(x) { - var div = x.nextSibling; - while (div != null && div.nodeType != 1) - div = div.nextSibling; - if (div != null) { - var d = div.style.display; - if (d == 'block' || d == '') { - div.style.display = 'none'; - x.className += " closed"; - } else { - div.style.display = 'block'; - x.className = x.className.replace(/(?:^|\s)closed(?!\S)/g , '' ); - } - } - } -</script> - -<!-- ======================================================================================================== --> -<a id="PredefinedFilters"></a><h2 class='topic'>1 - Predefined filter support</h2> -<p> - This package contains various predefined instances of filters for commonly-serialized/parsed class types. -</p> -<p> - See {@link com.ibm.juno.core.filter} for more information about filters. -</p> -</body> http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlBeanPropertyMeta.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlBeanPropertyMeta.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlBeanPropertyMeta.class deleted file mode 100755 index bcdcdb8..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlBeanPropertyMeta.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlBeanPropertyMeta.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlBeanPropertyMeta.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlBeanPropertyMeta.java deleted file mode 100755 index 4405f91..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlBeanPropertyMeta.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.html; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.html.annotation.*; - -/** - * Metadata on bean properties specific to the HTML serializers and parsers pulled from the {@link Html @Html} annotation on the bean property. - * - * @author James Bognar ([email protected]) - * @param <T> The bean class. - */ -public class HtmlBeanPropertyMeta<T> { - - private boolean asXml, noTables, noTableHeaders, asPlainText; - - /** - * Constructor. - * - * @param beanPropertyMeta The metadata of the bean property of this additional metadata. - */ - public HtmlBeanPropertyMeta(BeanPropertyMeta<T> beanPropertyMeta) { - if (beanPropertyMeta.getField() != null) - findHtmlInfo(beanPropertyMeta.getField().getAnnotation(Html.class)); - if (beanPropertyMeta.getGetter() != null) - findHtmlInfo(beanPropertyMeta.getGetter().getAnnotation(Html.class)); - if (beanPropertyMeta.getSetter() != null) - findHtmlInfo(beanPropertyMeta.getSetter().getAnnotation(Html.class)); - } - - private void findHtmlInfo(Html html) { - if (html == null) - return; - if (html.asXml()) - asXml = html.asXml(); - if (html.noTables()) - noTables = html.noTables(); - if (html.noTableHeaders()) - noTableHeaders = html.noTableHeaders(); - if (html.asPlainText()) - asPlainText = html.asPlainText(); - } - - /** - * Returns whether this bean property should be serialized as XML instead of HTML. - * - * @return <jk>true</jk> if the the {@link Html} annotation is specified, and {@link Html#asXml()} is <jk>true</jk>. - */ - protected boolean isAsXml() { - return asXml; - } - - /** - * Returns whether this bean property should be serialized as plain text instead of HTML. - * - * @return <jk>true</jk> if the the {@link Html} annotation is specified, and {@link Html#asPlainText()} is <jk>true</jk>. - */ - protected boolean isAsPlainText() { - return asPlainText; - } - - /** - * Returns whether this bean property should not be serialized as an HTML table. - * - * @return <jk>true</jk> if the the {@link Html} annotation is specified, and {@link Html#noTables()} is <jk>true</jk>. - */ - protected boolean isNoTables() { - return noTables; - } - - /** - * Returns whether this bean property should not include table headers when serialized as an HTML table. - * - * @return <jk>true</jk> if the the {@link Html} annotation is specified, and {@link Html#noTableHeaders()} is <jk>true</jk>. - */ - public boolean isNoTableHeaders() { - return noTableHeaders; - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlClassMeta.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlClassMeta.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlClassMeta.class deleted file mode 100755 index 74294b9..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlClassMeta.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlClassMeta.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlClassMeta.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlClassMeta.java deleted file mode 100755 index b5af7e5..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlClassMeta.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.html; - -import com.ibm.juno.core.html.annotation.*; -import com.ibm.juno.core.utils.*; - -/** - * Metadata on classes specific to the HTML serializers and parsers pulled from the {@link Html @Html} annotation on the class. - * - * @author James Bognar ([email protected]) - */ -public class HtmlClassMeta { - - private final Html html; - private final boolean asXml, noTables, noTableHeaders, asPlainText; - - /** - * Constructor. - * - * @param c The class that this annotation is defined on. - */ - public HtmlClassMeta(Class<?> c) { - this.html = ReflectionUtils.getAnnotation(Html.class, c); - if (html != null) { - asXml = html.asXml(); - noTables = html.noTables(); - noTableHeaders = html.noTableHeaders(); - asPlainText = html.asPlainText(); - } else { - asXml = false; - noTables = false; - noTableHeaders = false; - asPlainText = false; - } - } - - /** - * Returns the {@link Html} annotation defined on the class. - * - * @return The value of the {@link Html} annotation, or <jk>null</jk> if not specified. - */ - protected Html getAnnotation() { - return html; - } - - /** - * Returns the {@link Html#asXml()} annotation defined on the class. - * - * @return The value of the {@link Html#asXml()} annotation. - */ - protected boolean isAsXml() { - return asXml; - } - - /** - * Returns the {@link Html#asPlainText()} annotation defined on the class. - * - * @return The value of the {@link Html#asPlainText()} annotation. - */ - protected boolean isAsPlainText() { - return asPlainText; - } - - /** - * Returns the {@link Html#noTables()} annotation defined on the class. - * - * @return The value of the {@link Html#noTables()} annotation. - */ - protected boolean isNoTables() { - return noTables; - } - - /** - * Returns the {@link Html#noTableHeaders()} annotation defined on the class. - * - * @return The value of the {@link Html#noTableHeaders()} annotation. - */ - public boolean isNoTableHeaders() { - return noTableHeaders; - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializer.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializer.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializer.class deleted file mode 100755 index e0992ad..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializer.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializer.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializer.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializer.java deleted file mode 100755 index a58709d..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializer.java +++ /dev/null @@ -1,162 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.html; - -import java.io.*; -import java.lang.reflect.*; -import java.util.*; - -import com.ibm.juno.core.*; -import com.ibm.juno.core.annotation.*; -import com.ibm.juno.core.dto.*; -import com.ibm.juno.core.serializer.*; -import com.ibm.juno.core.utils.*; - -/** - * Serializes POJOs to HTTP responses as HTML documents. - * - * - * <h6 class='topic'>Media types</h6> - * <p> - * Handles <code>Accept</code> types: <code>text/html</code> - * <p> - * Produces <code>Content-Type</code> types: <code>text/html</code> - * - * - * <h6 class='topic'>Description</h6> - * <p> - * Same as {@link HtmlSerializer}, except wraps the response in <code><xt><html></code>, <code><xt><head></code>, - * and <code><xt><body></code> tags so that it can be rendered in a browser. - * - * - * <h6 class='topic'>Configurable properties</h6> - * <p> - * This class has the following properties associated with it: - * <ul> - * <li>{@link HtmlDocSerializerProperties} - * <li>{@link HtmlSerializerProperties} - * <li>{@link SerializerProperties} - * <li>{@link BeanContextProperties} - * </ul> - * - * - * @author James Bognar ([email protected]) - */ -@Produces("text/html") -public class HtmlDocSerializer extends HtmlStrippedDocSerializer { - - // Properties defined in RestServletProperties - private static final String - REST_method = "RestServlet.method", - REST_relativeServletURI = "RestServlet.relativeServletURI"; - - - //-------------------------------------------------------------------------------- - // Overridden methods - //-------------------------------------------------------------------------------- - - @Override /* Serializer */ - protected void doSerialize(Object o, Writer out, SerializerContext ctx) throws IOException, SerializeException { - - HtmlSerializerContext hctx = (HtmlSerializerContext)ctx; - HtmlSerializerWriter w = hctx.getWriter(out); - - ObjectMap properties = hctx.getProperties(); - - boolean isOptionsPage = properties.containsKey(REST_method) && properties.getString(REST_method).equalsIgnoreCase("OPTIONS"); - - // Render the header. - w.sTag("html").nl(); - w.sTag("head").nl(); - - String cssUrl = hctx.getCssUrl(); - if (cssUrl == null) - cssUrl = properties.getString(REST_relativeServletURI) + "/style.css"; - - w.oTag(1, "style") - .attr("type", "text/css") - .appendln(">") - .append(2, "@import ").q().append(cssUrl).q().appendln(";"); - if (hctx.isNoWrap()) - w.appendln("\n* {white-space:nowrap;}"); - if (hctx.getCssImports() != null) - for (String cssImport : hctx.getCssImports()) - w.append(2, "@import ").q().append(cssImport).q().appendln(";"); - w.eTag(1, "style").nl(); - w.eTag("head").nl(); - w.sTag("body").nl(); - // Write the title of the page. - String title = hctx.getTitle(); - if (title == null && isOptionsPage) - title = "Options"; - String description = hctx.getDescription(); - if (title != null) - w.oTag(1, "h3").attr("class", "title").append('>').encodeText(title).eTag("h3").nl(); - if (description != null) - w.oTag(1, "h5").attr("class", "description").append('>').encodeText(description).eTag("h5").nl(); - - // Write the action links that render above the results. - List<Link> actions = new LinkedList<Link>(); - - // If this is an OPTIONS request, provide a 'back' link to return to the GET request page. - if (! isOptionsPage) { - ObjectMap htmlLinks = hctx.getLinks(); - if (htmlLinks != null) { - for (Map.Entry<String,Object> e : htmlLinks.entrySet()) { - String uri = e.getValue().toString(); - if (uri.indexOf("://") == -1 && ! StringUtils.startsWith(uri, '/')) { - StringBuilder sb = new StringBuilder(properties.getString(REST_relativeServletURI)); - if (! (uri.isEmpty() || uri.charAt(0) == '?' || uri.charAt(0) == '/')) - sb.append('/'); - sb.append(uri); - uri = sb.toString(); - } - - actions.add(new Link(e.getKey(), uri)); - } - } - } - - if (actions.size() > 0) { - w.oTag(1, "p").attr("class", "links").append('>').nl(); - for (Iterator<Link> i = actions.iterator(); i.hasNext();) { - Link h = i.next(); - w.oTag(2, "a").attr("class", "link").attr("href", h.getHref(), true).append('>').append(h.getName()).eTag("a").nl(); - if (i.hasNext()) - w.append(3, " - ").nl(); - } - w.eTag(1, "p").nl(); - } - - hctx.indent = 3; - - // To allow for page formatting using CSS, we encapsulate the data inside two div tags: - // <div class='outerdata'><div class='data' id='data'>...</div></div> - w.oTag(1, "div").attr("class","outerdata").append('>').nl(); - w.oTag(2, "div").attr("class","data").attr("id", "data").append('>').nl(); - if (isEmptyList(o)) - w.oTag(3, "p").append('>').append("no results").eTag("p"); - else - super.doSerialize(o, w, hctx); - w.eTag(2, "div").nl(); - w.eTag(1, "div").nl(); - - w.eTag("body").nl().eTag("html").nl(); - } - - private boolean isEmptyList(Object o) { - if (o == null) - return false; - if (o instanceof Collection && ((Collection<?>)o).size() == 0) - return true; - if (o.getClass().isArray() && Array.getLength(o) == 0) - return true; - return false; - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializerProperties.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializerProperties.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializerProperties.class deleted file mode 100755 index b9afc9c..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializerProperties.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializerProperties.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializerProperties.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializerProperties.java deleted file mode 100755 index dd565af..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlDocSerializerProperties.java +++ /dev/null @@ -1,165 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2014, 2015. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.html; - - -/** - * Properties associated with the {@link HtmlDocSerializer} class. - * <p> - * These are typically specified via <ja>@RestResource.properties()</ja> and <ja>@RestMethod.properties()</ja> annotations, - * although they can also be set programmatically via the <code>RestREsponse.setProperty()</code> method. - * - * <h6 class='topic'>Example</h6> - * <p class='bcode'> - * <ja>@RestResource</ja>( - * messages=<js>"nls/AddressBookResource"</js>, - * properties={ - * <ja>@Property</ja>(name=HtmlDocSerializerProperties.<jsf>HTMLDOC_title</jsf>, value=<js>"$L{title}"</js>), - * <ja>@Property</ja>(name=HtmlDocSerializerProperties.<jsf>HTMLDOC_description</jsf>, value=<js>"$L{description}"</js>), - * <ja>@Property</ja>(name=HtmlDocSerializerProperties.<jsf>HTMLDOC_links</jsf>, value=<js>"{options:'?method=OPTIONS',doc:'doc'}"</js>) - * } - * ) - * <jk>public class</jk> AddressBookResource <jk>extends</jk> RestServletJenaDefault { - * </p> - * <p> - * The <code>$L{...}</code> variable represent localized strings pulled from the resource bundle identified by the <code>messages</code> annotation. - * These variables are replaced at runtime based on the HTTP request locale. - * Several built-in runtime variable types are defined, and the API can be extended to include user-defined variables. - * </p> - * - * @author James Bognar ([email protected]) - */ -public final class HtmlDocSerializerProperties { - - /** - * Adds a title at the top of a page. - * - * <dl> - * <dt>Example:</dt> - * <dd> - * <p> - * The <code>AddressBookResource</code> sample class uses this property... - * </p> - * <p class='bcode'> - * <ja>@RestResource</ja>( - * messages=<js>"nls/AddressBookResource"</js>, - * properties={ - * <ja>@Property</ja>(name=HtmlDocSerializerProperties.<jsf>HTMLDOC_title</jsf>, value=<js>"$L{title}"</js>) - * } - * ) - * <jk>public class</jk> AddressBookResource <jk>extends</jk> RestServletJenaDefault { - * </p> - * <p> - * ...with this property in <code>AddressBookResource.properties</code>... - * </p> - * <p class='bcode'> - * title = <js>AddressBook sample resource</js> - * </p> - * <p> - * ...to produce this title on the HTML page... - * </p> - * <img class='bordered' src='doc-files/HTML_TITLE.png'> - * </dd> - * </dl> - */ - public static final String HTMLDOC_title = "HtmlSerializer.title"; - - /** - * Adds a description right below the title of a page. - * - * <dl> - * <dt>Example:</dt> - * <dd> - * <p> - * The <code>AddressBookResource</code> sample class uses this property... - * </p> - * <p class='bcode'> - * <ja>@RestResource</ja>( - * messages=<js>"nls/AddressBookResource"</js>, - * properties={ - * <ja>@Property</ja>(name=HtmlDocSerializerProperties.<jsf>HTMLDOC_description</jsf>, value=<js>"description"</js>, type=<jsf>NLS</jsf>) - * } - * ) - * <jk>public class</jk> AddressBookResource <jk>extends</jk> RestServletJenaDefault { - * </p> - * <p> - * ...with this property in <code>AddressBookResource.properties</code>... - * </p> - * <p class='bcode'> - * description = <js>Simple address book POJO sample resource</js> - * </p> - * <p> - * ...to produce this description on the HTML page... - * </p> - * <img class='bordered' src='doc-files/HTML_DESCRIPTION.png'> - * </dd> - * </dl> - */ - public static final String HTMLDOC_description = "HtmlSerializer.description"; - - /** - * Adds a list of hyperlinks immediately under the title and description but above the content of the page. - * <p> - * This can be used to provide convenient hyperlinks when viewing the REST interface from a browser. - * <p> - * The value is a JSON object string where the keys are anchor text and the values are URLs. - * <p> - * Relative URLs are considered relative to the servlet path. - * For example, if the servlet path is <js>"http://localhost/myContext/myServlet"</js>, and the - * URL is <js>"foo"</js>, the link becomes <js>"http://localhost/myContext/myServlet/foo"</js>. - * Absolute (<js>"/myOtherContext/foo"</js>) and fully-qualified (<js>"http://localhost2/foo"</js>) URLs - * can also be used. - * - * <dl> - * <dt>Example:</dt> - * <dd> - * <p> - * The <code>AddressBookResource</code> sample class uses this property... - * </p> - * <p class='bcode'> - * <ja>@RestResource</ja>( - * messages=<js>"nls/AddressBookResource"</js>, - * properties={ - * <ja>@Property</ja>(name=HtmlDocSerializerProperties.<jsf>HTMLDOC_links</jsf>, value=<js>"{options:'?method=OPTIONS',doc:'doc'}"</js>) - * } - * ) - * <jk>public class</jk> AddressBookResource <jk>extends</jk> RestServletJenaDefault { - * </p> - * <p> - * ...to produce this list of links on the HTML page... - * </p> - * <img class='bordered' src='doc-files/HTML_LINKS.png'> - * </dd> - * </dl> - */ - public static final String HTMLDOC_links = "HtmlDocSerializer.links"; - - /** - * Similar to {@link #HTMLDOC_links} except appends on to the existing list of links. - */ - public static final String HTMLDOC_addLinks = "HtmlDocSerializer.addLinks"; - - /** - * Adds a link to the specified stylesheet URL. - * <p> - * If not specified, defaults to the built-in stylesheet located at <js>"/servletPath/style.css"</js>. - * Note that this stylesheet is controlled by the <code><ja>@RestResource</ja>.style()</code> annotation. - */ - public static final String HTMLDOC_cssUrl = "HtmlDocSerializer.cssUrl"; - - /** - * Imports the specified CSS page URLs into the page. - */ - public static final String HTMLDOC_cssImports = "HtmlDocSerializer.cssImports"; - - /** - * Adds <js>"* {white-space:nowrap}"</js> to the style header to prevent word wrapping. - */ - public static final String HTMLDOC_nowrap = "HtmlDocSerializer.nowrap"; -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlLink.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlLink.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlLink.class deleted file mode 100755 index 54ac01b..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlLink.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlLink.java ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlLink.java b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlLink.java deleted file mode 100755 index 208f1bd..0000000 --- a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlLink.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Licensed Materials - Property of IBM - * (c) Copyright IBM Corporation 2011, 2014. All Rights Reserved. - * - * The source code for this program is not published or otherwise - * divested of its trade secrets, irrespective of what has been - * deposited with the U.S. Copyright Office. - *******************************************************************************/ -package com.ibm.juno.core.html; - -import static java.lang.annotation.ElementType.*; -import static java.lang.annotation.RetentionPolicy.*; - -import java.lang.annotation.*; - -/** - * Used in conjunction with the {@link HtmlSerializer} class to define hyperlinks. - * <p> - * This annotation is applied to classes. - * <p> - * Annotation that can be used to specify that a class has a URL associated with it. - * <p> - * When rendered using the {@link com.ibm.juno.core.html.HtmlSerializer HtmlSerializer} class, this class will get rendered as a hyperlink like so... - * <p class='code'> - * <xt><a</xt> <xa>href</xa>=<xs>'hrefProperty'</xs><xt>></xt>nameProperty<xt></a></xt> - * </p> - * - * @author James Bognar ([email protected]) - */ -@Documented -@Target(TYPE) -@Retention(RUNTIME) -@Inherited -public @interface HtmlLink { - - /** - * The bean property whose value becomes the name in the hyperlink. - */ - String nameProperty() default ""; - - /** - * The bean property whose value becomes the url in the hyperlink. - */ - String hrefProperty() default ""; -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlParser$Tag.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlParser$Tag.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlParser$Tag.class deleted file mode 100755 index 70e31b6..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlParser$Tag.class and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/30947fd7/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlParser.class ---------------------------------------------------------------------- diff --git a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlParser.class b/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlParser.class deleted file mode 100755 index 9c3206d..0000000 Binary files a/com.ibm.team.juno.releng/bin/core/com/ibm/juno/core/html/HtmlParser.class and /dev/null differ
