The following document contains the results of PMD's CPD 4.1.
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/OneToOneRelation.java | 176 |
| pl/edu/agh/cast/data/model/general/TimedOneToOneRelation.java | 172 |
}
// END Protected Constructors
// END Constructors
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.general.IOneToOneRelation#getSourceEntity()
*/
@Override
public IEntity getSourceEntity() {
return this.getSourceEntities().iterator().next();
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.general.IOneToOneRelation
* #setSourceEntity(pl.edu.agh.cast.data.model.general.IEntity)
*/
@Override
public void setSourceEntity(IEntity entity) {
setSourceEntities(Collections.singletonList(entity));
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.general.IOneToOneRelation#getTargetEntity()
*/
@Override
public IEntity getTargetEntity() {
return this.getTargetEntities().iterator().next();
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.general.IOneToOneRelation
* #setTargetEntity(pl.edu.agh.cast.data.model.general.IEntity)
*/
@Override
public void setTargetEntity(IEntity entity) {
setTargetEntities(Collections.singletonList(entity));
}
// BEGIN Replication Methods
/**
* {@inheritDoc}
*
* <p>
* Replicates relation direction, the lists of source and target entities are empty.
*
* @see ManyToManyRelation#replicateTo(java.lang.Object)
*/
@Override
public TimedOneToOneRelation replicateTo(Object replica) throws IllegalArgumentException, ReplicationException {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PermanentProperty.java | 43 |
| pl/edu/agh/cast/data/model/property/TransientProperty.java | 44 |
public TransientProperty(MetaTransientProperty metaProperty, Object element) {
super(metaProperty);
if (element == null) {
throw new IllegalArgumentException("Element cannot be null"); //$NON-NLS-1$
}
this.element = element;
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.Property#getValue()
*/
@Override
public Object getValue() {
try {
return this.getMetaProperty().getGetter().invoke(this.element);
} catch (Exception e) {
throw new PropertyException("Failed to access property value", e); //$NON-NLS-1$
}
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.Property#setValue(java.lang.Object)
*/
@Override
public void setValue(Object value) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/CustomProperty.java | 65 |
| pl/edu/agh/cast/data/model/property/PermanentProperty.java | 63 |
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.Property#setValue(java.lang.Object)
*/
@Override
public void setValue(Object value) {
if (!this.getMetaProperty().isWritable()) {
throw new PropertyException("The property is not writable"); //$NON-NLS-1$
}
if (!this.isValidValue(value)) {
throw new PropertyException(String.format("Invalid value for property of type '%1$s': %2$s", //$NON-NLS-1$
this.getMetaProperty().getType(), (value != null) ? value.getClass() : null));
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/validator/ReferenceListPropertyValidator.java | 73 |
| pl/edu/agh/cast/data/model/property/validator/TextArrayPropertyValidator.java | 87 |
return String[].class;
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.model.attributes.validation.AttributeValidator#convertToStringFormat(java.lang.Object)
*/
@SuppressWarnings("nls")
public String convertToStringFormat(Object value) {
if (value == null) {
return null;
}
if (!isValidClass(value)) {
throw new IllegalArgumentException("Wrong value type tried to be converted. Actual value type: "
+ value.getClass() + ". Expected value type: " + getTypeClass());
}
StringBuilder result = new StringBuilder();
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 105 |
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 136 |
PropertySetter annotation = entry.getValue().get(0);
String name = annotation.name().trim();
MetaPermanentPropertyDescription prop = properties.get(name);
if (prop == null) {
prop = new MetaPermanentPropertyDescription(name);
properties.put(name, prop);
}
if (prop.setter != null) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPermanentProperty.java | 99 |
| pl/edu/agh/cast/data/model/property/MetaTransientProperty.java | 72 |
super(name, type, false, matchable);
if (getter == null) {
throw new IllegalArgumentException("Getter method cannot be null"); //$NON-NLS-1$
}
if (!PropertyHelper.verifyGetterSignature(getter, type.getValidator().getTypeClass())) {
throw new IllegalArgumentException(String.format(
"Getter method has invalid signature for value type '%1$s': %2$s", type, getter)); //$NON-NLS-1$
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/validator/PropertyValidator.java | 71 |
| pl/edu/agh/cast/data/model/property/validator/ReferenceListPropertyValidator.java | 74 |
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.model.attributes.validation.AttributeValidator#convertToStringFormat(java.lang.Object)
*/
@SuppressWarnings("nls")
public String convertToStringFormat(Object value) {
if (value == null) {
return null;
}
if (!isValidClass(value)) {
throw new IllegalArgumentException("Wrong value type tried to be converted. Actual value type: "
+ value.getClass() + ". Expected value type: " + getTypeClass());
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationDataSet.java | 182 |
| pl/edu/agh/cast/data/model/presentation/PresentationElement.java | 197 |
getVisualElement().removePropertyChangeListener(listener);
}
}
/**
* Fires the property change event.
*
* @param property
* the name of the property
* @param oldValue
* the old value of the property
* @param newValue
* the new value of the property
*
* @see pl.edu.agh.cast.data.model.property.PropertyChangeProviderHelper#firePropertyChange(java.lang.String,
* java.lang.Object, java.lang.Object)
*/
protected final void firePropertyChange(String property, Object oldValue, Object newValue) {
pcpHelper.firePropertyChange(property, oldValue, newValue);
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.presentation.IPresentationDataSet#setSuppressAllEvents(boolean)
*/
@Override
public void setSuppressAllEvents(boolean flag) {
pcpHelper.setSuppressAllEvents(flag);
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/AbstractDataSet.java | 479 |
| pl/edu/agh/cast/data/model/AbstractDataSet.java | 496 |
public final <E extends T> Collection<E> removeElements(E... elements) {
List<E> removedElements = new LinkedList<E>();
for (E element : elements) {
if (getElement(element.getId()) != null) {
removedElements.add(removeElement(element));
}
}
// TODO [kpietak] add here template method <code>afterRemoveElements</code>
return removedElements;
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/common/SupportedDateFormat.java | 65 |
| pl/edu/agh/cast/data/model/common/SupportedTimeFormat.java | 71 |
private SupportedTimeFormat(String format) {
this.sdp = new SimpleDateFormat(format);
this.sdp.setLenient(false);
}
/**
* Parsed given text according to all supported formats. The first matching format is chosen, however the formats
* order is not defined.
*
* @param text
* text to parse.
* @return parsed date object or null if text is null
* @throws ParseException
* if text does not match to any format. exception generated by the last format is thrown
*/
public static Date parse(String text) throws ParseException {
if (text == null) {
return null;
}
ParseException ex = null;
for (SupportedTimeFormat format : SupportedTimeFormat.values()) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationDataSet.java | 184 |
| pl/edu/agh/cast/data/model/visual/VisualDataSet.java | 359 |
}
/**
* Fires the property change event.
*
* @param property
* the name of the property
* @param oldValue
* the old value of the property
* @param newValue
* the new value of the property
*
* @see pl.edu.agh.cast.data.model.property.PropertyChangeProviderHelper#firePropertyChange(java.lang.String,
* java.lang.Object, java.lang.Object)
*/
protected final void firePropertyChange(String property, Object oldValue, Object newValue) {
pcpHelper.firePropertyChange(property, oldValue, newValue);
}
/**
*
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.visual.IVisualDataSet#setSuppressAllEvents(boolean)
*/
@Override
public void setSuppressAllEvents(boolean flag) {
pcpHelper.setSuppressAllEvents(flag);
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/sample/SampleGeneralDataSet.java | 85 |
| pl/edu/agh/cast/data/model/general/sample/SampleGeneralDataSet.java | 96 |
entity4), false); cal.set(2009, 1, 2, 12, 0); dateStart = cal.getTime(); cal.set(2009, 1, 2, 13, 30); dateEnd = cal.getTime(); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/visual/VisualDataSet.java | 357 |
| pl/edu/agh/cast/data/model/visual/VisualElement.java | 305 |
public final void removePropertyChangeListener(PropertyChangeListener l) {
pcpHelper.removePropertyChangeListener(l);
}
/**
* Fires the property change event.
*
* @param property
* the name of the property
* @param oldValue
* the old value of the property
* @param newValue
* the new value of the property
*
* @see pl.edu.agh.cast.data.model.property.PropertyChangeProviderHelper#firePropertyChange(java.lang.String,
* java.lang.Object, java.lang.Object)
*/
protected final void firePropertyChange(String property, Object oldValue, Object newValue) {
pcpHelper.firePropertyChange(property, oldValue, newValue);
}
// END Property Change Support
// BEGIN Replication Methods
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.AbstractElement#replicateTo(java.lang.Object)
*/
@SuppressWarnings("unchecked")
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 96 |
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 125 |
public TimedManyToManyRelation(UUID id, IGeneralDataSet<? extends IGeneralElement> dataSet,
List<? extends IEntity> sources, List<? extends IEntity> targets, boolean directed, Date startDate,
Date endDate) {
this(ITimedManyToManyRelation.TYPE, id, sources, targets, directed, startDate, endDate);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/common/SupportedDateFormat.java | 87 |
| pl/edu/agh/cast/data/model/common/SupportedTimeFormat.java | 92 |
for (SupportedTimeFormat format : SupportedTimeFormat.values()) {
try {
return format.sdp.parse(text);
} catch (ParseException e) {
ex = e;
}
}
// here, ex is never null
throw ex;
}
/**
* Formats time using the default format: HH:mm:ss.
*
* @param time
* time to format
* @return formated time as string
*/
public static String formatDefault(Date time) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/GeneralDataSet.java | 183 |
| pl/edu/agh/cast/data/model/general/GeneralDataSet.java | 211 |
if (element.getType().isSubtypeOf(IManyToManyRelation.TYPE)) {
IManyToManyRelation relation = (IManyToManyRelation)element;
for (IEntity source : relation.getSourceEntities()) {
source.removeOutgoingRelation(relation);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/AbstractElement.java | 176 |
| pl/edu/agh/cast/data/model/DataSetDescriptor.java | 191 |
return type;
}
/**
* Sets the type of the data set. This method may be called only once, if the type is not set yet.
*
* @param type
* the data set type
*
* @throws ModelException
* if the type is already set
* @throws IllegalArgumentException
* if the given type is <code>null</code> or is not a type of data set
*/
public final void setType(Type type) {
if (this.type != null && !this.type.equals(type)) {
throw new ModelException("Type cannot be modified");
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/AbstractElement.java | 147 |
| pl/edu/agh/cast/data/model/DataSetDescriptor.java | 161 |
return id;
}
/**
* Sets the ID of the data set. The ID cannot be changed.
*
* @param id
* the data set ID
*
* @throws ModelException
* if the ID is already set and it is not equal to given one
* @throws IllegalArgumentException
* if the given ID is <code>null</code>
*/
public final void setId(UUID id) {
if (this.id != null && !this.id.equals(id)) {
throw new ModelException("ID cannot be modified");
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 100 |
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 197 |
TransientProperty.class).getMap().entrySet()) {
Method method = entry.getKey();
if (entry.getValue().size() == 1) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 121 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 145 |
public ManyToManyRelation(UUID id, IGeneralDataSet<? extends IGeneralElement> dataSet,
List<? extends IEntity> sources, List<? extends IEntity> targets, boolean directed) {
this(IManyToManyRelation.TYPE, id, dataSet, sources, targets, directed);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/AbstractDataSet.java | 835 |
| pl/edu/agh/cast/data/model/AbstractElement.java | 280 |
}
/**
* Returns the hash code of the element.
*
* <p>
* This method will throw {@link NullPointerException} if the ID is not set.
*
* <p>
* {@inheritDoc}
*
* @see #getId()
* @see java.lang.Object#hashCode()
*/
@Override
public final int hashCode() {
return getId().hashCode();
}
/**
* {@inheritDoc}
*
* @see java.lang.Object#toString()
*/
@Override
public final String toString() {
return String.format("E [%1$s] %2$s (%3$s)", getType(), getId(), getDescString()); //$NON-NLS-1$
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/Type.java | 77 |
| pl/edu/agh/cast/data/model/Type.java | 93 |
public static Type fromClass(Class<? extends Identifiable> klass) {
Type type = typeCache.get(klass.getName());
if (type == null) {
type = instantiateType(klass);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 145 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 212 |
protected ManyToManyRelation(Type type, UUID id, IGeneralDataSet<? extends IGeneralElement> dataSet,
List<? extends IEntity> sources, List<? extends IEntity> targets, boolean directed) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/converter/ConverterInputEntry.java | 60 |
| pl/edu/agh/cast/data/model/DataSetDescriptor.java | 209 |
if (type == null) {
throw new IllegalArgumentException("Type cannot be null");
}
if (!type.isSubtypeOf(IDataSet.TYPE)) {
throw new IllegalArgumentException("The type must be a subtype of IDataSet");
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/visual/IVisualDataSet.java | 55 |
| pl/edu/agh/cast/data/model/visual/VisualDataSet.java | 47 |
public abstract class VisualDataSet<T extends IVisualElement<? extends IPresentationElement<? extends IElement>>, M extends IPresentationDataSet<? extends IPresentationElement<? extends IElement>>>
extends AbstractDataSet<T> implements IVisualDataSet<T, M> {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 145 |
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 125 |
public TimedManyToManyRelation(UUID id, IGeneralDataSet<? extends IGeneralElement> dataSet, List<? extends IEntity> sources, List<? extends IEntity> targets, boolean directed, Date startDate, | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/converter/AbstractConverter.java | 73 |
| pl/edu/agh/cast/data/converter/IConverter.java | 59 |
public <T extends IDataSet<? extends IElement>> T convert( MultiMap<ConverterInputEntry, ? extends IDataSet<? extends IElement>> dataSets) throws ConverterException; | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 98 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 145 |
public ManyToManyRelation(UUID id, IGeneralDataSet<? extends IGeneralElement> dataSet,
List<? extends IEntity> sources, List<? extends IEntity> targets, boolean directed) {
this(IManyToManyRelation.TYPE, id, dataSet, sources, targets, directed);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/converter/AbstractConverter.java | 61 |
| pl/edu/agh/cast/data/converter/IConverter.java | 75 |
public <T extends IDataSet<? extends IElement>> T convert(List<? extends IDataSet<? extends IElement>> dataSets) throws ConverterException; | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/validator/ReferenceListPropertyValidator.java | 99 |
| pl/edu/agh/cast/data/model/property/validator/TextArrayPropertyValidator.java | 115 |
if (inputArray.length > 0) {
result.delete(result.length() - 2, result.length());
}
return result.toString();
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationDataSet.java | 184 |
| pl/edu/agh/cast/data/model/visual/VisualElement.java | 307 |
}
/**
* Fires the property change event.
*
* @param property
* the name of the property
* @param oldValue
* the old value of the property
* @param newValue
* the new value of the property
*
* @see pl.edu.agh.cast.data.model.property.PropertyChangeProviderHelper#firePropertyChange(java.lang.String,
* java.lang.Object, java.lang.Object)
*/
protected final void firePropertyChange(String property, Object oldValue, Object newValue) {
pcpHelper.firePropertyChange(property, oldValue, newValue);
}
// END Property Change Support
// BEGIN Replication Methods
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.AbstractElement#replicateTo(java.lang.Object)
*/
@SuppressWarnings("unchecked")
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationDataSet.java | 168 |
| pl/edu/agh/cast/data/model/presentation/PresentationElement.java | 183 |
getVisualElement().addPropertyChangeListener(listener);
}
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.IPropertyChangeProvider
* #removePropertyChangeListener(java.beans.PropertyChangeListener)
*/
@Override
public final void removePropertyChangeListener(PropertyChangeListener listener) {
pcpHelper.removePropertyChangeListener(listener);
if (visualElement != null) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaProperty.java | 93 |
| pl/edu/agh/cast/data/model/property/MetaPropertyManager.java | 165 |
public MetaProperty removeMetaProperty(String name) {
if (!PropertyHelper.isValidPropertyName(name)) {
throw new IllegalArgumentException(String.format("Name '%s' is not a valid property name", //$NON-NLS-1$
name));
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 96 |
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 173 |
protected TimedManyToManyRelation(Type type, UUID id, List<? extends IEntity> sources,
List<? extends IEntity> targets, boolean directed, Date startDate, Date endDate) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 121 |
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 96 |
public TimedManyToManyRelation(IGeneralDataSet<? extends IGeneralElement> dataSet, List<? extends IEntity> sources,
List<? extends IEntity> targets, boolean directed, Date startDate, Date endDate) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 98 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 121 |
public ManyToManyRelation(IGeneralDataSet<? extends IGeneralElement> dataSet, List<? extends IEntity> sources,
List<? extends IEntity> targets, boolean directed) {
this(IManyToManyRelation.TYPE, UUID.randomUUID(), dataSet, sources, targets, directed);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/domain/DomainDataSet.java | 96 |
| pl/edu/agh/cast/data/model/presentation/PresentationDataSet.java | 107 |
setOriginalDataSets(originalDataSets);
}
// END Constructors
// BEGIN Descriptor Handling
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.AbstractDataSet#isDescriptorValid(pl.edu.agh.cast.data.model.DataSetDescriptor)
*/
@Override
protected final boolean isDescriptorValid(DataSetDescriptor descriptor) {
return super.isDescriptorValid(descriptor) && descriptor.getClass() == PresentationDataSetDescriptor.class;
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/visual/VisualElement.java | 77 |
| pl/edu/agh/cast/data/model/visual/VisualElement.java | 92 |
this(dataSet, type, UUID.randomUUID(), presentationElement);
}
/**
* Constructor.
*
* @param dataSet
* data set which this element belongs to
* @param type
* element type
* @param id
* the ID of the element
* @param presentationElement
* a presentation element which is described by this visual element.
*/
protected VisualElement(IVisualDataSet<? extends IVisualElement<?>, ? extends IPresentationDataSet<?>> dataSet,
Type type, UUID id, M presentationElement) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 121 |
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 220 |
metaProperties.put(name, new MetaTransientProperty(name, displayName, type, matchable, method));
} else if (entry.getValue().size() > 1) {
throw new PropertyAnnotationException(String.format(
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationDataSet.java | 108 |
| pl/edu/agh/cast/data/model/visual/VisualDataSet.java | 117 |
}
// END Constructors
// BEGIN Descriptor Handling
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.AbstractDataSet#isDescriptorValid(pl.edu.agh.cast.data.model.DataSetDescriptor)
*/
@Override
protected final boolean isDescriptorValid(DataSetDescriptor descriptor) {
return super.isDescriptorValid(descriptor) && descriptor.getClass() == VisualDataSetDescriptor.class;
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 594 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 598 |
for (IEntity entity : getTargetEntities()) {
sb.append(entity.getName()).append(Constants.STRING_SPACE);
}
sb.append("]");
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 212 |
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 96 |
public TimedManyToManyRelation(IGeneralDataSet<? extends IGeneralElement> dataSet, List<? extends IEntity> sources,
List<? extends IEntity> targets, boolean directed, Date startDate, Date endDate) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 187 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 212 |
protected ManyToManyRelation(Type type, UUID id, IGeneralDataSet<? extends IGeneralElement> dataSet,
List<? extends IEntity> sources, List<? extends IEntity> targets, boolean directed) {
super(type, id, dataSet);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 145 |
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 96 |
public TimedManyToManyRelation(IGeneralDataSet<? extends IGeneralElement> dataSet, List<? extends IEntity> sources,
List<? extends IEntity> targets, boolean directed, Date startDate, Date endDate) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/domain/DomainDataSet.java | 97 |
| pl/edu/agh/cast/data/model/visual/VisualDataSet.java | 117 |
}
// END Constructors
// BEGIN Descriptor Handling
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.AbstractDataSet#isDescriptorValid(pl.edu.agh.cast.data.model.DataSetDescriptor)
*/
@Override
protected final boolean isDescriptorValid(DataSetDescriptor descriptor) {
return super.isDescriptorValid(descriptor) && descriptor.getClass() == VisualDataSetDescriptor.class;
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 122 |
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 149 |
} else if (entry.getValue().size() > 1) {
throw new PropertyAnnotationException(String.format(
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPropertyManager.java | 74 |
| pl/edu/agh/cast/data/model/property/MetaPropertyManager.java | 182 |
this.metaTransientProperties.remove((MetaTransientProperty)metaProperty);
} else if (metaProperty.getClass() == MetaProperty.class) {
this.metaCustomProperties.remove(metaProperty);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPropertyManager.java | 72 |
| pl/edu/agh/cast/data/model/property/MetaPropertyManager.java | 180 |
this.metaPermanentProperties.remove((MetaPermanentProperty)metaProperty);
} else if (metaProperty.getClass() == MetaTransientProperty.class) {
this.metaTransientProperties.remove((MetaTransientProperty)metaProperty);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/TimedOneToOneRelation.java | 84 |
| pl/edu/agh/cast/data/model/general/TimedOneToOneRelation.java | 107 |
this(dataSet, ReferenceUtil.getInstance().createReferenceList(source), ReferenceUtil.getInstance() .createReferenceList(target), directed, date); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 174 |
| pl/edu/agh/cast/data/model/general/TimedOneToOneRelation.java | 170 |
IReferenceList<IEntity> targets, boolean directed, Date startDate, Date endDate) {
super(type, id, sources, targets, directed, startDate, endDate);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/OneToOneRelation.java | 91 |
| pl/edu/agh/cast/data/model/general/TimedOneToOneRelation.java | 84 |
this(ITimedOneToOneRelation.TYPE, id, ReferenceUtil.getInstance().createReferenceList(source), ReferenceUtil .getInstance().createReferenceList(target), directed, startDate, endDate); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 187 |
| pl/edu/agh/cast/data/model/general/TimedManyToManyRelation.java | 173 |
protected TimedManyToManyRelation(Type type, UUID id, List<? extends IEntity> sources,
List<? extends IEntity> targets, boolean directed, Date startDate, Date endDate) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/AbstractDataSet.java | 854 |
| pl/edu/agh/cast/data/model/AbstractElement.java | 306 |
return String.format("E [%1$s] %2$s (%3$s)", getType(), getId(), getDescString()); //$NON-NLS-1$
}
/**
* Returns a string with short description of element. This method is used by {@link #toString()} and may be
* overridden in order to customize its results.
*
* @return a description string
*/
protected String getDescString() {
return "";
}
// END Object Methods
// BEGIN Helper Methods
/**
* Verifies constructor arguments (<em>dataSet</em> and <em>type</em>) and, if successful, returns a meta-property
* manager from given data set based on given type.
*
* @param dataSet
* the data set to verify
* @param type
* the type to verify
* @return instance of {@link MetaPropertyManager} from <em>dataSet</em> based on <em>type</em>
*
* @see IDataSet#getMetaPropertyManager(Type)
*/
private static MetaPropertyManager preprocessConstructorArguments(IDataSet<?> dataSet, Type type) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 105 |
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 202 |
TransientProperty annotation = entry.getValue().get(0); String name = annotation.name().trim(); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/IPresentationDataSet.java | 131 |
| pl/edu/agh/cast/data/model/presentation/PresentationDataSet.java | 295 |
public final <V extends IVisualDataSet<? extends IVisualElement<T>, ? extends IPresentationDataSet<T>>> V getVisualDataSet() {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/OneToOneRelation.java | 91 |
| pl/edu/agh/cast/data/model/general/TimedOneToOneRelation.java | 107 |
this(dataSet, ReferenceUtil.getInstance().createReferenceList(source), ReferenceUtil.getInstance() .createReferenceList(target), directed, date); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/OneToOneRelation.java | 73 |
| pl/edu/agh/cast/data/model/general/OneToOneRelation.java | 108 |
public OneToOneRelation(IGeneralDataSet<? extends IGeneralElement> dataSet, IEntity source, IEntity target,
boolean directed) {
this(UUID.randomUUID(), source, target, directed);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 234 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 497 |
if (entities instanceof IReferenceList) {
this.targets = (IReferenceList<IEntity>)entities;
} else {
this.targets.setReferences(entities);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 222 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 407 |
if (entities instanceof IReferenceList) {
this.sources = (IReferenceList<IEntity>)entities;
} else {
this.sources.setReferences(entities);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/Entity.java | 263 |
| pl/edu/agh/cast/data/model/general/Entity.java | 367 |
if (relations instanceof IReferenceList) {
this.outgoingRelations = (IReferenceList<IManyToManyRelation>)relations;
} else {
this.outgoingRelations.setReferences(relations);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/Entity.java | 251 |
| pl/edu/agh/cast/data/model/general/Entity.java | 303 |
if (relations instanceof IReferenceList) {
this.incomingRelations = (IReferenceList<IManyToManyRelation>)relations;
} else {
this.incomingRelations.setReferences(relations);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/validator/TextArrayPropertyValidator.java | 55 |
| pl/edu/agh/cast/data/model/property/validator/TextPropertyValidator.java | 32 |
@Override
protected boolean checkFormat(String value) {
return true;
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.validator.PropertyValidator#convert(java.lang.String)
*/
@Override
protected Object convert(String value) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 163 |
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 168 |
if (prop.setter != null && !verifySetterSignature(prop.setter, prop.type.getValidator().getTypeClass())) {
throw new PropertyAnnotationException(String.format(
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 98 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 187 |
protected ManyToManyRelation(Type type, UUID id, List<? extends IEntity> sources, List<? extends IEntity> targets,
boolean directed) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/GeneralDataSet.java | 134 |
| pl/edu/agh/cast/data/model/general/GeneralDataSet.java | 183 |
if (element.getType().isSubtypeOf(IManyToManyRelation.TYPE)) {
IManyToManyRelation relation = (IManyToManyRelation)element;
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/common/SupportedDateFormat.java | 120 |
| pl/edu/agh/cast/data/model/common/SupportedTimeFormat.java | 125 |
return this.sdp.format(time);
}
/**
* Returns the time format.
*
* @return time format
*/
public String getFormat() {
return sdp.toPattern();
}
/**
* Returns the default time format.
*
* @return default time format
*/
public static String getDefaultFormat() {
return HH_MM_SS_COLON.getFormat();
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/util/ReferenceUtil.java | 82 |
| pl/edu/agh/cast/data/model/util/ReferenceUtil.java | 152 |
public <T extends Identifiable> IReferenceList<T> createReferenceList(Iterable<T> instances, Type type) {
return new ReferenceList<T>(instances, type);
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPermanentProperty.java | 55 |
| pl/edu/agh/cast/data/model/property/MetaPermanentProperty.java | 76 |
this(name, displayName, type, matchable, getter, setter, true);
}
/**
* Creates new permanent meta property with the given writable flag.
*
* @param name
* the name of the property
* @param displayName
* the display name of the property
* @param type
* the type of property value
* @param matchable
* the matchable flag
* @param getter
* value getter method
* @param setter
* value setter method
* @param writable
* flat which indicates if the property is writable
*/
public MetaPermanentProperty(String name, String displayName, PropertyType type, boolean matchable, Method getter,
Method setter, boolean writable) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/sample/SampleGeneralDataSet.java | 95 |
| pl/edu/agh/cast/data/model/general/sample/SampleGeneralDataSet.java | 103 |
ITimedManyToManyRelation tm2m = new TimedManyToManyRelation(this, Arrays.asList(entity1, entity2), Arrays .asList(entity3, entity4), false, dateStart, dateEnd); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/converter/ConverterInputEntry.java | 59 |
| pl/edu/agh/cast/data/model/AbstractElement.java | 363 |
private static void verifyType(Type type) throws IllegalArgumentException {
if (type == null) {
throw new IllegalArgumentException("Type cannot be null");
}
if (!type.isSubtypeOf(IElement.TYPE)) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/util/IReferenceProvider.java | 68 |
| pl/edu/agh/cast/data/model/util/ReferenceUtil.java | 152 |
public <T extends Identifiable> IReferenceList<T> createReferenceList(Iterable<T> instances, Type type) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaProperty.java | 177 |
| pl/edu/agh/cast/data/model/property/MetaTransientProperty.java | 104 |
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.MetaProperty#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof MetaTransientProperty)) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPermanentProperty.java | 166 |
| pl/edu/agh/cast/data/model/property/MetaTransientProperty.java | 121 |
MetaTransientProperty that = (MetaTransientProperty)obj; return this.getter.get().equals(that.getter.get()); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPermanentProperty.java | 149 |
| pl/edu/agh/cast/data/model/property/MetaTransientProperty.java | 104 |
}
/**
* Returns <code>true</code> if given object is of type {@link MetaProperty} and has equal <em>name</em>,
* <em>type</em>, <em>writable</em> and <em>matchable</em> flags.
*
* {@inheritDoc}
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof MetaProperty)) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPermanentProperty.java | 104 |
| pl/edu/agh/cast/data/model/property/MetaPermanentProperty.java | 109 |
if (setter != null && !PropertyHelper.verifySetterSignature(setter, type.getValidator().getTypeClass())) {
throw new IllegalArgumentException(String.format(
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationPropertyDescriptor.java | 97 |
| pl/edu/agh/cast/data/model/property/Property.java | 139 |
public int hashCode() {
final int prime = 31;
int result = prime;
result = prime * result + this.getMetaProperty().hashCode();
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 225 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 237 |
this.targets = ReferenceUtil.getInstance().createEmptyReferenceList((IEntity)null);
if (entities != null) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 121 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 187 |
protected ManyToManyRelation(Type type, UUID id, List<? extends IEntity> sources, List<? extends IEntity> targets,
boolean directed) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/Entity.java | 298 |
| pl/edu/agh/cast/data/model/general/Entity.java | 362 |
public final void setOutgoingRelations(List<? extends IManyToManyRelation> relations) {
if (relations == null) {
throw new IllegalArgumentException("Outgoing relations cannot be null");
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/Entity.java | 254 |
| pl/edu/agh/cast/data/model/general/Entity.java | 266 |
this.outgoingRelations = ReferenceUtil.getInstance().createEmptyReferenceList((IManyToManyRelation)null);
if (relations != null) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/AbstractElement.java | 364 |
| pl/edu/agh/cast/data/model/DataSetDescriptor.java | 209 |
if (type == null) {
throw new IllegalArgumentException("Type cannot be null");
}
if (!type.isSubtypeOf(IDataSet.TYPE)) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/AbstractDataSet.java | 394 |
| pl/edu/agh/cast/data/model/AbstractDataSet.java | 409 |
throw new IllegalArgumentException("Element list cannot be null");
}
for (T element : elements) {
addElement(element);
}
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.IDataSet#setElements(java.util.Collection)
*/
@Override
public final void setElements(Collection<? extends T> elemnts) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/util/IReferenceProvider.java | 68 |
| pl/edu/agh/cast/data/model/util/ReferenceUtil.java | 82 |
public final <T extends Identifiable> IReferenceList<T> createReferenceList(Iterable<T> instances, Type type) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/validator/ColorPropertyValidator.java | 39 |
| pl/edu/agh/cast/data/model/property/validator/IdPropertyValidator.java | 39 |
} catch (IllegalArgumentException e) {
return false;
}
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.validator.PropertyValidator#convert(java.lang.String)
*/
@Override
protected Object convert(String value) {
try {
return UUID.fromString(value.trim());
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/validator/BooleanPropertyValidator.java | 54 |
| pl/edu/agh/cast/data/model/property/validator/IntegerPropertyValidator.java | 49 |
return Integer.parseInt(value.trim());
}
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.validator.PropertyValidator#getTypeClass()
*/
@Override
public Class<?> getTypeClass() {
return Integer.class;
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 163 |
| pl/edu/agh/cast/data/model/property/PropertyHelper.java | 214 |
if (!verifyGetterSignature(method, type.getValidator().getTypeClass())) {
throw new PropertyAnnotationException(String.format(
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyContainer.java | 190 |
| pl/edu/agh/cast/data/model/property/PropertyContainer.java | 213 |
public Property<? extends MetaProperty> removeProperty(String name) {
if (!PropertyHelper.isValidPropertyName(name)) {
throw new IllegalArgumentException("Invalid name of the property to remove");
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/PropertyContainer.java | 118 |
| pl/edu/agh/cast/data/model/property/PropertyContainer.java | 164 |
TransientProperty property = (TransientProperty)this.propertyMap.get(metaProperty.getName());
if (property != null) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPropertyManager.java | 165 |
| pl/edu/agh/cast/data/model/property/PropertyContainer.java | 190 |
public Property<? extends MetaProperty> getProperty(String name) {
if (!PropertyHelper.isValidPropertyName(name)) {
throw new IllegalArgumentException("Invalid name of the property to retrieve");
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/property/MetaPermanentProperty.java | 158 |
| pl/edu/agh/cast/data/model/property/MetaTransientProperty.java | 113 |
if (obj == null || !(obj instanceof MetaTransientProperty)) {
return false;
}
if (!super.equals(obj)) {
return false;
}
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationElement.java | 101 |
| pl/edu/agh/cast/data/model/presentation/PresentationElement.java | 135 |
}
/**
* The constructor for presentation elements created manually. The presentation element belongs to the presentation
* data set and ID given in the constructor. The type of the element might be schema node, etc. The given list of
* referenced elements is used.
*
* @param dataSet
* the data set given element belongs to
* @param type
* the type of the element
* @param id
* the ID of the element
* @param originalElements
* the list of originalElements to represented domain model elements - if <code>null</code>, then empty
* {@link IReferenceList} instance is acquired from {@link ReferenceUtil}
*/
protected PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet, Type type, UUID id,
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationElement.java | 79 |
| pl/edu/agh/cast/data/model/presentation/PresentationElement.java | 116 |
this(dataSet, type, id, null);
}
/**
* The constructor for presentation elements created manually. The presentation element belongs to the presentation
* data set given in the constructor. The type of the element might be schema node, etc. The given list of
* referenced elements is used. The ID is randomly generated.
*
* @param dataSet
* the data set given element belongs to
* @param type
* the type of the element
* @param originalElements
* the list of references to represented domain model elements - if <code>null</code>, then empty
* {@link IReferenceList} instance is acquired from {@link ReferenceUtil}
*/
protected PresentationElement(IPresentationDataSet<? extends IPresentationElement<?>> dataSet, Type type,
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/PresentationDataSet.java | 152 |
| pl/edu/agh/cast/data/model/presentation/PresentationElement.java | 169 |
}
// BEGIN Property Change Support
/**
* {@inheritDoc}
*
* @see pl.edu.agh.cast.data.model.property.IPropertyChangeProvider
* #addPropertyChangeListener(java.beans.PropertyChangeListener)
*/
@Override
public final void addPropertyChangeListener(PropertyChangeListener listener) {
pcpHelper.addPropertyChangeListener(listener);
if (visualElement != null) {
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/presentation/IPresentationDataSet.java | 88 |
| pl/edu/agh/cast/data/model/visual/IVisualDataSet.java | 61 |
public static final Type TYPE = Type.fromClass(IVisualDataSet.class); /** * Collection of element types accepted by this type of data set. */ public static final Collection<Type> ACCEPTED_TYPES = Collections.unmodifiableCollection(Arrays .asList(IVisualElement.TYPE)); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 421 |
| pl/edu/agh/cast/data/model/general/ManyToManyRelation.java | 511 |
public final void addTargetEntitiy(IEntity entity) throws ModelException {
if (!verifyEntity(entity)) {
throw new ModelException("Entity is not valid for addition to target list.");
| |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/model/IDataSet.java | 79 |
| pl/edu/agh/cast/data/model/visual/IVisualDataSet.java | 61 |
public static final Type TYPE = Type.fromClass(IPresentationDataSet.class); /** * Collection of element types accepted by this type of data set. */ public static final Collection<Type> ACCEPTED_TYPES = Collections.unmodifiableCollection(Arrays .asList(IPresentationElement.TYPE)); | |
| File | Line |
|---|---|
| pl/edu/agh/cast/data/converter/ConverterSpecification.java | 123 |
| pl/edu/agh/cast/data/converter/ConverterSpecification.java | 128 |
if (entry == null) {
throw new ConverterException(String.format("Data set of type '%s' is not legal for this converter", ds
.getType()));
}
| |