/** * Tests whether this datatype is xsd:string. * * @return true if the datatype is xsd:string. */ public boolean isString() { return getTopicIF().getSubjectIdentifiers().contains(DataTypes.TYPE_STRING); }
/** * Tests whether this datatype is xsd:number. * * @return true if the datatype is xsd:number. */ public boolean isNumber() { return getTopicIF().getSubjectIdentifiers().contains(DataTypes.TYPE_DECIMAL); }
/** * Tests whether this datatype is xsd:base64Binary (binary content). * * @return true if the datatype is xsd:base64Binary (binary content). */ public boolean isBinary() { return getTopicIF().getSubjectIdentifiers().contains(DataTypes.TYPE_BINARY); }
/** * Tests whether this interface control is on:drop-down-list. * * @return true if this interface control is on:drop-down-list. */ public boolean isDropDownList() { return getTopicIF().getSubjectIdentifiers().contains( PSI.ON_INTERFACE_CONTROL_DROP_DOWN_LIST); }
/** * Tests whether this datatype is xsd:date. * * @return true if the datatype is xsd:date. */ public boolean isDate() { return getTopicIF().getSubjectIdentifiers().contains(DataTypes.TYPE_DATE); }
/** * Tests whether this datatype is xsd:anyUri. * * @return true if the datatype is xsd:anyUri. */ public boolean isURI() { return getTopicIF().getSubjectIdentifiers().contains(DataTypes.TYPE_URI); }
/** * Tests whether this datatype is on:datatype-html. * * @return true if the datatype is on:datatype-html. */ public boolean isHTML() { return getTopicIF().getSubjectIdentifiers().contains(PSI.ON_DATATYPE_HTML); }
/** * Tests whether this datatype is on:datatype-image. * * @return true if the datatype is on:datatype-image. */ public boolean isImage() { return getTopicIF().getSubjectIdentifiers().contains(PSI.ON_DATATYPE_IMAGE); }
/** * Returns true if name type is on:untyped. */ public boolean isUntypedName() { return getTopicIF().getSubjectIdentifiers().contains(PSI.TMDM_TOPIC_NAME); }
/** * Tests whether this interface control is on:browse-dialog. * * @return true if this interface control is on:browse-dialog. */ public boolean isBrowseDialog() { return getTopicIF().getSubjectIdentifiers().contains( PSI.ON_INTERFACE_CONTROL_BROWSE_DIALOG); }
/** * Tests whether this interface control is on:auto-complete * * @return true if this interface control is on:auto-complete. */ public boolean isAutoComplete() { return getTopicIF().getSubjectIdentifiers().contains( PSI.ON_INTERFACE_CONTROL_AUTO_COMPLETE); }
private static boolean isTEDTopic(TopicIF topic) { Iterator<LocatorIF> iter = topic.getSubjectIdentifiers().iterator(); while (iter.hasNext()) { LocatorIF loc = iter.next(); String address = loc.getAddress(); if (address.startsWith("http://psi.ontopia.net/ontology/") || address.startsWith("http://www.techquila.com/psi/hierarchy/")) return true; } return false; }
/** * Tests whether this datatype is xsd:datetime. * * @return true if the datatype is xsd:datetime. */ public boolean isDateTime() { return getTopicIF().getSubjectIdentifiers().contains(DataTypes.TYPE_DATETIME); }
/** * Tests whether this interface control is on:search-dialog. * * @return true if this interface control is on:search-dialog. */ public boolean isSearchDialog() { return getTopicIF().getSubjectIdentifiers().contains( PSI.ON_INTERFACE_CONTROL_SEARCH_DIALOG); }
public String getTypeURI() { // tells us if it's edit-page, view-page ... if (topic.getTypes().isEmpty()) return null; TopicIF type = topic.getTypes().iterator().next(); if (type.getSubjectIdentifiers().isEmpty()) return null; LocatorIF psi = type.getSubjectIdentifiers().iterator().next(); return psi.getAddress(); } }
private AResource getResource(TopicIF topic) { LocatorIF locator = null; if (locator == null && !topic.getSubjectLocators().isEmpty()) locator = (LocatorIF) topic.getSubjectLocators().iterator().next(); if (locator == null && !topic.getSubjectIdentifiers().isEmpty()) locator = (LocatorIF) topic.getSubjectIdentifiers().iterator().next(); if (locator != null) return new AResourceWrapper(locator.getExternalForm()); return makeAnonymousNode(topic); }
/** * True if this is the subject identifier field type. */ public boolean isSubjectIdentifier() { IdentityType itype = getIdentityType(); if (itype == null) return false; TopicIF itypeIF = itype.getTopicIF(); return itypeIF.getSubjectIdentifiers().contains(PSI.ON_SUBJECT_IDENTIFIER); }
/** * True if this is the item identifier field type. */ public boolean isItemIdentifier() { IdentityType itype = getIdentityType(); if (itype == null) return false; TopicIF itypeIF = itype.getTopicIF(); return itypeIF.getSubjectIdentifiers().contains(PSI.ON_ITEM_IDENTIFIER); }
private String getElementTypeName(TopicIF topic, String def) { if (topic == null) return def; Collection subjids = topic.getSubjectIdentifiers(); if (!subjids.isEmpty()) { LocatorIF subjid = (LocatorIF) subjids.iterator().next(); return getElementTypeName(subjid.getAddress()); } return getTopicId(topic); }
private String get(TopicIF topic, LocatorIF psi) { for (OccurrenceIF occ : topic.getOccurrences()) { TopicIF type = occ.getType(); if (type.getSubjectIdentifiers().contains(psi)) return occ.getValue(); } return null; }