@Nullable public ContainerType getContainerType() { Container container = this.getAnnotation(Container.class); return container != null ? container.value() : null; }
@Nullable public String getIDNamespace() { Id annotation = getAnnotation(Id.class); return annotation != null ? annotation.ns() : null; }
@Nullable public IDType getIDType() { Id annotation = getAnnotation(Id.class); return annotation != null ? annotation.value() : null; }
public boolean isList() { // refers to List RDF mapping, not the java.util.List type Container container = getAnnotation(Container.class); if (container != null) { return ContainerType.LIST == container.value(); } else { return List.class.isAssignableFrom(getType()) || type.isArray(); } }
public boolean isContainer() { Container container = this.getAnnotation(Container.class); return container != null && container.value() != ContainerType.LIST && container.value() != ContainerType.NONE; }
public List<UID> getDefaults() { Default[] defaults; Defaults defs = getAnnotation(Defaults.class); if (defs != null) { defaults = defs.value(); } else { Default def = getAnnotation(Default.class); if (def != null) { defaults = new Default[] { def }; } else { defaults = new Default[0]; } } List<UID> rs = new ArrayList<UID>(defaults.length); for (Default def : defaults) { // TODO: Use default ns and ln if there's only one default? rs.add(UID.create(null, def.ns(), def.ln(), name)); } return rs; }
public MappedPath(MappedProperty<?> property, List<MappedPredicate> predicatePath, boolean inherited) { this.mappedProperty = property; this.predicatePath = predicatePath; this.inherited = inherited; Path path = property.getAnnotation(Path.class); if (path != null) { this.ignoreInvalid = path.ignoreInvalid(); } else { if (predicatePath.size() > 0) { this.ignoreInvalid = predicatePath.get(0).ignoreInvalid(); } else { this.ignoreInvalid = false; } } validate(); }
@Nullable private List<MappedPredicate> getPredicatePath(String classNs, MappedProperty<?> property) { String parentNs = classNs; Path path = property.getAnnotation(Path.class); Predicate[] predicates; if (path != null) { Predicate predicate = property.getAnnotation(Predicate.class); if (predicate != null) { predicates = new Predicate[] { predicate };
@Nullable public UID getKeyPredicate() { MapElements mapKey = getAnnotation(MapElements.class); if (mapKey != null) { Predicate predicate = mapKey.key(); // String parentNs = getParentNs(mapKey, getMember()); return UID.create(declaringClass.getClassNs(), predicate.ns(), predicate.ln(), null); } else { return null; } }
@Nullable public UID getValuePredicate() { MapElements mapKey = getAnnotation(MapElements.class); if (mapKey != null) { Predicate predicate = mapKey.value(); try { // String parentNs = getParentNs(mapKey, getMember()); return UID.create(declaringClass.getClassNs(), predicate.ns(), predicate.ln(), null); } catch (IllegalArgumentException e) { return null; } } else { return null; } }
ComponentType ctypeAnno = getAnnotation(ComponentType.class); if (ctypeAnno != null) { this.componentType = ctypeAnno.value(); this.componentType = type.getComponentType(); } else if (isMap()) { MapElements mapKey = getAnnotation(MapElements.class); if (mapKey != null && !Void.class.equals(mapKey.keyType())) { keyType = mapKey.keyType(); Properties propertiesAnno = getAnnotation(Properties.class); if (propertiesAnno != null) { includeMapped = propertiesAnno.includeMapped();