/** * Set an extra attribute. An extra attribute is an attribute that is not provided by a bean-style setter. * * The default implementation throws {@link NoSuchAttributeException}. * * @param name The attribute name to clear. * @param val The attribute value to set. */ public <T> void setExtraAttribute(TypedName<T> name, T val) { throw new NoSuchAttributeException(name.toString()); }
/** * {@inheritDoc} * * This implementation delegates to {@link #maybeGet(String)}. */ @Nonnull @Override public Object get(String attr) { Object val = maybeGet(attr); if (val == null) { throw new NoSuchAttributeException(attr); } else { return val; } }
/** * {@inheritDoc} * * This implementation delegates to {@link #maybeGet(TypedName)}. */ @Nonnull @Override public <T> T get(TypedName<T> name) { T val = maybeGet(name); if (val == null) { throw new NoSuchAttributeException(name.toString()); } else { return val; } }
@Override public double getDouble(TypedName<Double> name) { int idx = layout.attributes.lookup(name); if (idx >= 0) { BeanAttributeGetter gf = layout.getters.get(idx); return gf.getDouble(this); } else { throw new NoSuchAttributeException(name.toString()); } }
@Override public int getInteger(TypedName<Integer> name) { int idx = layout.attributes.lookup(name); if (idx >= 0) { BeanAttributeGetter gf = layout.getters.get(idx); return gf.getInt(this); } else { throw new NoSuchAttributeException(name.toString()); } }
@Override public long getLong(TypedName<Long> name) { int idx = layout.attributes.lookup(name); if (idx >= 0) { BeanAttributeGetter gf = layout.getters.get(idx); return gf.getLong(this); } else { throw new NoSuchAttributeException(name.toString()); } }
@Override public boolean getBoolean(TypedName<Boolean> name) { int idx = layout.attributes.lookup(name); if (idx >= 0) { BeanAttributeGetter gf = layout.getters.get(idx); return gf.getBoolean(this); } else { throw new NoSuchAttributeException(name.toString()); } }
@Override public long getLong(TypedName<Long> name) { int ap = attributes.lookup(name); if (ap < 0) { throw new NoSuchAttributeException(name.toString()); } AttrStore as = attrStores[ap]; if (as.isNull(position)) { throw new NoSuchElementException(name.toString()); } assert as instanceof LongAttrStore; return ((LongAttrStore) as).getLong(position); } }
/** * Set an extra attribute. An extra attribute is an attribute that is not provided by a bean-style setter. * * The default implementation throws {@link NoSuchAttributeException}. * * @param name The attribute name to clear. * @param val The attribute value to set. */ public <T> void setExtraAttribute(TypedName<T> name, T val) { throw new NoSuchAttributeException(name.toString()); }
/** * {@inheritDoc} * * This implementation delegates to {@link #maybeGet(String)}. */ @Nonnull @Override public Object get(String attr) { Object val = maybeGet(attr); if (val == null) { throw new NoSuchAttributeException(attr); } else { return val; } }
/** * {@inheritDoc} * * This implementation delegates to {@link #maybeGet(TypedName)}. */ @Nonnull @Override public <T> T get(TypedName<T> name) { T val = maybeGet(name); if (val == null) { throw new NoSuchAttributeException(name.toString()); } else { return val; } }
@Override public boolean getBoolean(TypedName<Boolean> name) { int idx = layout.attributes.lookup(name); if (idx >= 0) { BeanAttributeGetter gf = layout.getters.get(idx); return gf.getBoolean(this); } else { throw new NoSuchAttributeException(name.toString()); } }
@Override public int getInteger(TypedName<Integer> name) { int idx = layout.attributes.lookup(name); if (idx >= 0) { BeanAttributeGetter gf = layout.getters.get(idx); return gf.getInt(this); } else { throw new NoSuchAttributeException(name.toString()); } }
@Override public long getLong(TypedName<Long> name) { int idx = layout.attributes.lookup(name); if (idx >= 0) { BeanAttributeGetter gf = layout.getters.get(idx); return gf.getLong(this); } else { throw new NoSuchAttributeException(name.toString()); } }
@Override public double getDouble(TypedName<Double> name) { int idx = layout.attributes.lookup(name); if (idx >= 0) { BeanAttributeGetter gf = layout.getters.get(idx); return gf.getDouble(this); } else { throw new NoSuchAttributeException(name.toString()); } }
@Override public long getLong(TypedName<Long> name) { int ap = attributes.lookup(name); if (ap < 0) { throw new NoSuchAttributeException(name.toString()); } AttrStore as = attrStores[ap]; if (as.isNull(position)) { throw new NoSuchElementException(name.toString()); } assert as instanceof LongAttrStore; return ((LongAttrStore) as).getLong(position); } }