Example usage for java.lang Class Class

List of usage examples for java.lang Class Class

Introduction

In this page you can find the example usage for java.lang Class Class.

Prototype

private Class(ClassLoader loader, Class<?> arrayComponentType) 

Source Link

Usage

From source file:com.xpn.xwiki.api.Document.java

public Class getxWikiClass() {
    BaseClass bclass = this.getDoc().getXClass();
    if (bclass == null) {
        return null;
    } else {//from  w  ww .  j  a v  a 2 s.c  o  m
        return new Class(bclass, getXWikiContext());
    }
}

From source file:com.xpn.xwiki.api.Document.java

public Class[] getxWikiClasses() {
    List<BaseClass> list = this.getDoc().getXClasses(getXWikiContext());
    if (list == null) {
        return null;
    }/*w w w. j  a  va  2 s .c o m*/
    Class[] result = new Class[list.size()];
    for (int i = 0; i < list.size(); i++) {
        result[i] = new Class(list.get(i), getXWikiContext());
    }
    return result;
}

From source file:com.xpn.xwiki.api.XWiki.java

/**
 * Get the XWiki Class object defined in the passed Document name.
 * <p>/*from w w w . j ava2  s  . co m*/
 * Note: This method doesn't require any rights for accessing the passed Document (as opposed to the
 * {@link com.xpn.xwiki.api.Document#getClass()} method which does require to get a Document object first. This is
 * thus useful in cases where the calling code doesn't have the access right to the specified Document. It is safe
 * because there are no sensitive data stored in a Class definition.
 * </p>
 * 
 * @param documentName the name of the document for which to get the Class object. For example
 *            "XWiki.XWikiPreferences"
 * @return the XWiki Class object defined in the passed Document name. If the passed Document name points to a
 *         Document with no Class defined then an empty Class object is returned (i.e. a Class object with no
 *         properties).
 * @throws XWikiException if the passed document name doesn't point to a valid Document
 */
public Class getClass(String documentName) throws XWikiException {
    // TODO: The implementation should be done in com.xpn.xwiki.XWiki as this class should
    // delegate all implementations to that Class.
    return new Class(this.xwiki.getDocument(documentName, this.context).getXClass(), this.context);
}