io.github.mmm.entity.property.link.PropertyFactoryLink Maven / Gradle / Ivy
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.entity.property.link;
import io.github.mmm.entity.bean.EntityBean;
import io.github.mmm.entity.link.Link;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.ReadableProperty;
import io.github.mmm.property.WritableProperty;
import io.github.mmm.property.factory.AbstractPropertyFactory;
import io.github.mmm.property.factory.PropertyFactory;
import io.github.mmm.property.factory.PropertyTypeInfo;
/**
* Implementation of {@link PropertyFactory} for {@link LinkProperty}.
*
* @param the generic type of the {@link Link#getTarget() linked} {@link EntityBean}.
*
* @since 1.0.0
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public class PropertyFactoryLink extends AbstractPropertyFactory, LinkProperty> {
@Override
public Class> getValueClass() {
return (Class) Link.class;
}
@Override
public Class extends ReadableProperty>> getReadableInterface() {
return null;
}
@Override
public Class extends WritableProperty>> getWritableInterface() {
return null;
}
@Override
public Class> getImplementationClass() {
return (Class) LinkProperty.class;
}
@Override
public LinkProperty create(String name, PropertyTypeInfo> typeInfo, PropertyMetadata> metadata) {
Class entityClass = typeInfo.getTypeArgumentClass(0);
return new LinkProperty<>(name, entityClass, metadata);
}
@Override
public boolean isPolymorphic() {
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy