当前位置: 首页>>代码示例>>Java>>正文


Java Iri类代码示例

本文整理汇总了Java中org.openrdf.annotations.Iri的典型用法代码示例。如果您正苦于以下问题:Java Iri类的具体用法?Java Iri怎么用?Java Iri使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Iri类属于org.openrdf.annotations包,在下文中一共展示了Iri类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDeclaringJavaClazz

import org.openrdf.annotations.Iri; //导入依赖的package包/类
/**
 * Returns the Java resource object that is declaring a method or a field.
 * If the given object is a method the resource object it is declared in is returned.
 * If the given object is a field that is declared in a {@link Partial} class then
 * the resource object superinterface is returned.
 * @param object The object which declaring class to get.
 * @return Returns the class that is declaring the given object or null if the given object
 * is neither a method nor a field or if no resource object interface is found.
 */
private Class<?> getDeclaringJavaClazz(AccessibleObject object) {
    if(object instanceof Method) {
        return ((Method) object).getDeclaringClass();
    } else if(object instanceof Field) {
        Class<?> declaringClass = ((Field) object).getDeclaringClass();

        if (declaringClass.isAnnotationPresent(Partial.class)) {
            for(Class<?> iface : declaringClass.getInterfaces()) {
                if (iface.isAnnotationPresent(Iri.class)) {
                    return iface;
                }
            }
            return null;
        } else {
            return null;
        }

    } else {
        return null;
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:31,代码来源:OWLSchemaPersistingManager.java

示例2: scanConceptsWithReflections

import org.openrdf.annotations.Iri; //导入依赖的package包/类
private void scanConceptsWithReflections() throws ObjectStoreConfigException {
    logger.debug("Search for concepts with reflections");
    Set<URL> classpath = new HashSet<>();
    classpath.addAll(ClasspathHelper.forClassLoader());
    classpath.addAll(ClasspathHelper.forJavaClassPath());
    classpath.addAll(ClasspathHelper.forManifest());
    classpath.addAll(ClasspathHelper.forPackage(""));
    Reflections reflections = new Reflections(new ConfigurationBuilder()
            .setUrls(classpath)
.useParallelExecutor()
.filterInputsBy(FilterBuilder.parsePackages("-java, -javax, -sun, -com.sun"))
            .setScanners(new SubTypesScanner(), new TypeAnnotationsScanner()));

    Set<Class<?>> annotated = reflections.getTypesAnnotatedWith(Iri.class, true);
    logger.debug("Search for concepts with reflections resulted in " + annotated.size() + " classes");
    for (Class clazz : annotated) {
        logger.debug("Found concept class: " + clazz.getCanonicalName());
        roleMapper.addConcept(clazz);
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:21,代码来源:RoleClassLoader.java

示例3: findInterfaceMethod

import org.openrdf.annotations.Iri; //导入依赖的package包/类
private Method findInterfaceMethod(Class<?>[] interfaces, String name,
		Class<?> type, Class<?>[] types) {
	Collection<Method> methods = findInterfaceMethods(interfaces, name, type, types);
	Collection<Method> withIdentifiers = new LinkedHashSet<Method>();
	for (Method m : methods) {
		Annotation[][] anns = m.getParameterAnnotations();
		for (int i = 0; i < anns.length; i++) {
			for (int j = 0; j < anns[i].length; j++) {
				if (anns[i][j].annotationType().equals(Iri.class)) {
					withIdentifiers.add(m); // parameter IRI present
				}
			}
		}
	}
	if (withIdentifiers.isEmpty())
		return findSubMethod(methods);
	return findSubMethod(withIdentifiers);
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:19,代码来源:ClassComposer.java

示例4: createAdvice

import org.openrdf.annotations.Iri; //导入依赖的package包/类
@Override
public Advice createAdvice(final Method method) {
	return new Advice() {
		
		@Override
		public Object intercept(ObjectMessage message) throws Exception {
			String iri = method.getAnnotation(Iri.class).value();
			if (iri.equals(override))
				return true;
			return message.proceed();
		}
	};
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:14,代码来源:SubMethodTest.java

示例5: isImplementationPresent

import org.openrdf.annotations.Iri; //导入依赖的package包/类
private boolean isImplementationPresent(Class<?> type, String iri, Set<Class<?>> ignore) {
	if (type == null || ignore.contains(type))
		return false;
	Iri id = type.getAnnotation(Iri.class);
	if (id != null && iri.equals(id.value()))
		return true;
	for (Class<?> face : type.getInterfaces()) {
		if (isImplementationPresent(face, iri, ignore))
			return true;
	}
	return isImplementationPresent(type.getSuperclass(), iri, ignore);
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:13,代码来源:RoleMapper.java

示例6: findPredicate

import org.openrdf.annotations.Iri; //导入依赖的package包/类
public String findPredicate(PropertyDescriptor pd) {
	Method method = pd.getReadMethod();
	Class<?> dc = method.getDeclaringClass();
	String key = dc.getName() + "." + getPropertyName(method);
	if (properties.containsKey(key))
		return (String) properties.get(key);
	Method getter = method;
	Iri rdf = getter.getAnnotation(Iri.class);
	if (rdf == null)
		return null;
	return rdf.value();
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:13,代码来源:PropertyMapper.java

示例7: isAnnotationPresent

import org.openrdf.annotations.Iri; //导入依赖的package包/类
private boolean isAnnotationPresent(Class<?> clazz) {
	for (Annotation ann : clazz.getAnnotations()) {
		String name = ann.annotationType().getName();
		if (Iri.class.getName().equals(name))
			return true;
		if (Matching.class.getName().equals(name))
			return true;
	}
	return false;
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:11,代码来源:RoleClassLoader.java

示例8: packageInfo

import org.openrdf.annotations.Iri; //导入依赖的package包/类
private void packageInfo(String namespace, JavaMessageBuilder builder)
		throws ObjectStoreConfigException {
	builder.comment(this);
	builder.annotationProperties(this);
	builder.annotateString(Prefix.class.getName(), "value", builder
			.getMemberPrefix(namespace));
	builder.annotateString(Iri.class.getName(), "value", namespace);
	builder.pkg(builder.getPackageName(new URIImpl(namespace)));
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:10,代码来源:RDFOntology.java

示例9: getMinCardinality

import org.openrdf.annotations.Iri; //导入依赖的package包/类
@Iri(OWL.MIN_CARDINALITY)
Set<Number> getMinCardinality();
 
开发者ID:anno4j,项目名称:anno4j,代码行数:3,代码来源:Restriction.java

示例10: getFormat

import org.openrdf.annotations.Iri; //导入依赖的package包/类
@Iri(DC.FORMAT)
public abstract String getFormat();
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:3,代码来源:TextAreaBody.java

示例11: getAnotherValue

import org.openrdf.annotations.Iri; //导入依赖的package包/类
@Iri("http://www.example.com/schema#logicalTestAnotherValue")
String getAnotherValue();
 
开发者ID:anno4j,项目名称:anno4j,代码行数:3,代码来源:LogicalTests.java

示例12: setValue

import org.openrdf.annotations.Iri; //导入依赖的package包/类
@Iri(RDF.VALUE)
void setValue(String value);
 
开发者ID:anno4j,项目名称:anno4j,代码行数:3,代码来源:ObjectParserTest.java

示例13:

import org.openrdf.annotations.Iri; //导入依赖的package包/类
@Iri("http://example.de/inverseof_2")
Set<TestResource> getInverseOf2();
 
开发者ID:anno4j,项目名称:anno4j,代码行数:3,代码来源:ValidatedTransactionTest.java

示例14: getMaxCardinality

import org.openrdf.annotations.Iri; //导入依赖的package包/类
@Iri(OWL.MAX_CARDINALITY)
Set<Number> getMaxCardinality();
 
开发者ID:anno4j,项目名称:anno4j,代码行数:3,代码来源:Restriction.java

示例15: getClassName

import org.openrdf.annotations.Iri; //导入依赖的package包/类
@Iri("urn:test:className")
String getClassName();
 
开发者ID:anno4j,项目名称:anno4j,代码行数:3,代码来源:ConceptClassTest.java


注:本文中的org.openrdf.annotations.Iri类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。