id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
102,900 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/NodeServiceImpl.java | NodeServiceImpl.moveObject | @Override
public void moveObject(final FedoraSession session, final String source, final String destination) {
final Session jcrSession = getJcrSession(session);
try {
final FedoraResource srcResource = find(session, source);
final Node sourceNode = getJcrNode(srcResource);
... | java | @Override
public void moveObject(final FedoraSession session, final String source, final String destination) {
final Session jcrSession = getJcrSession(session);
try {
final FedoraResource srcResource = find(session, source);
final Node sourceNode = getJcrNode(srcResource);
... | [
"@",
"Override",
"public",
"void",
"moveObject",
"(",
"final",
"FedoraSession",
"session",
",",
"final",
"String",
"source",
",",
"final",
"String",
"destination",
")",
"{",
"final",
"Session",
"jcrSession",
"=",
"getJcrSession",
"(",
"session",
")",
";",
"try... | Move an existing object from the source path to the destination path
@param session the session
@param source the source path
@param destination the destination path | [
"Move",
"an",
"existing",
"object",
"from",
"the",
"source",
"path",
"to",
"the",
"destination",
"path"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/NodeServiceImpl.java#L110-L131 |
102,901 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/InternalFedoraBinary.java | InternalFedoraBinary.getBinaryContent | private javax.jcr.Binary getBinaryContent() {
try {
return getProperty(JCR_DATA).getBinary();
} catch (final PathNotFoundException e) {
throw new PathNotFoundRuntimeException(e);
} catch (final RepositoryException e) {
throw new RepositoryRuntimeException(e);
... | java | private javax.jcr.Binary getBinaryContent() {
try {
return getProperty(JCR_DATA).getBinary();
} catch (final PathNotFoundException e) {
throw new PathNotFoundRuntimeException(e);
} catch (final RepositoryException e) {
throw new RepositoryRuntimeException(e);
... | [
"private",
"javax",
".",
"jcr",
".",
"Binary",
"getBinaryContent",
"(",
")",
"{",
"try",
"{",
"return",
"getProperty",
"(",
"JCR_DATA",
")",
".",
"getBinary",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"PathNotFoundException",
"e",
")",
"{",
"throw",
"ne... | Retrieve the JCR Binary object
@return a JCR-wrapped Binary object | [
"Retrieve",
"the",
"JCR",
"Binary",
"object"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/InternalFedoraBinary.java#L93-L101 |
102,902 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/InternalFedoraBinary.java | InternalFedoraBinary.verifyChecksums | private void verifyChecksums(final Collection<URI> checksums, final Property dataProperty)
throws InvalidChecksumException {
final Map<URI, URI> checksumErrors = new HashMap<>();
// Loop through provided checksums validating against computed values
checksums.forEach(checksum -> {
... | java | private void verifyChecksums(final Collection<URI> checksums, final Property dataProperty)
throws InvalidChecksumException {
final Map<URI, URI> checksumErrors = new HashMap<>();
// Loop through provided checksums validating against computed values
checksums.forEach(checksum -> {
... | [
"private",
"void",
"verifyChecksums",
"(",
"final",
"Collection",
"<",
"URI",
">",
"checksums",
",",
"final",
"Property",
"dataProperty",
")",
"throws",
"InvalidChecksumException",
"{",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"checksumErrors",
"=",
"new",
... | This method ensures that the arg checksums are valid against the binary associated with the arg dataProperty.
If one or more of the checksums are invalid, an InvalidChecksumException is thrown.
@param checksums that the user provided
@param dataProperty containing the binary against which the checksums will be verifie... | [
"This",
"method",
"ensures",
"that",
"the",
"arg",
"checksums",
"are",
"valid",
"against",
"the",
"binary",
"associated",
"with",
"the",
"arg",
"dataProperty",
".",
"If",
"one",
"or",
"more",
"of",
"the",
"checksums",
"are",
"invalid",
"an",
"InvalidChecksumEx... | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/InternalFedoraBinary.java#L200-L243 |
102,903 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/InternalFedoraBinary.java | InternalFedoraBinary.decorateContentNode | private static void decorateContentNode(final Node dsNode, final Node descNode, final Collection<URI> checksums)
throws RepositoryException {
if (dsNode == null) {
LOGGER.warn("{} node appears to be null!", JCR_CONTENT);
return;
}
if (dsNode.hasProperty(JCR_DATA... | java | private static void decorateContentNode(final Node dsNode, final Node descNode, final Collection<URI> checksums)
throws RepositoryException {
if (dsNode == null) {
LOGGER.warn("{} node appears to be null!", JCR_CONTENT);
return;
}
if (dsNode.hasProperty(JCR_DATA... | [
"private",
"static",
"void",
"decorateContentNode",
"(",
"final",
"Node",
"dsNode",
",",
"final",
"Node",
"descNode",
",",
"final",
"Collection",
"<",
"URI",
">",
"checksums",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"dsNode",
"==",
"null",
")",
... | Add necessary information to node
@param dsNode The target binary node to add information to
@param descNode The description node associated with the binary node
@param checksums The checksum information
@throws RepositoryException on error | [
"Add",
"necessary",
"information",
"to",
"node"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/InternalFedoraBinary.java#L288-L313 |
102,904 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/impl/LdpContainerRdfContext.java | LdpContainerRdfContext.memberRelations | private Stream<Triple> memberRelations(final FedoraResource container) throws RepositoryException {
final org.apache.jena.graph.Node memberRelation;
if (container.hasProperty(LDP_HAS_MEMBER_RELATION)) {
final Property property = getJcrNode(container).getProperty(LDP_HAS_MEMBER_RELATION);
... | java | private Stream<Triple> memberRelations(final FedoraResource container) throws RepositoryException {
final org.apache.jena.graph.Node memberRelation;
if (container.hasProperty(LDP_HAS_MEMBER_RELATION)) {
final Property property = getJcrNode(container).getProperty(LDP_HAS_MEMBER_RELATION);
... | [
"private",
"Stream",
"<",
"Triple",
">",
"memberRelations",
"(",
"final",
"FedoraResource",
"container",
")",
"throws",
"RepositoryException",
"{",
"final",
"org",
".",
"apache",
".",
"jena",
".",
"graph",
".",
"Node",
"memberRelation",
";",
"if",
"(",
"contai... | Get the member relations assert on the subject by the given node
@param container with relations
@return Stream of triples
@throws RepositoryException on error | [
"Get",
"the",
"member",
"relations",
"assert",
"on",
"the",
"subject",
"by",
"the",
"given",
"node"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/impl/LdpContainerRdfContext.java#L95-L147 |
102,905 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java | FedoraResourceImpl.nodeToGoodChildren | @SuppressWarnings("unchecked")
private Stream<FedoraResource> nodeToGoodChildren(final Node input) throws RepositoryException {
return iteratorToStream(input.getNodes()).filter(nastyChildren.negate())
.flatMap(uncheck((final Node child) -> child.isNodeType(FEDORA_PAIRTREE) ? nodeToGoodChildren(c... | java | @SuppressWarnings("unchecked")
private Stream<FedoraResource> nodeToGoodChildren(final Node input) throws RepositoryException {
return iteratorToStream(input.getNodes()).filter(nastyChildren.negate())
.flatMap(uncheck((final Node child) -> child.isNodeType(FEDORA_PAIRTREE) ? nodeToGoodChildren(c... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Stream",
"<",
"FedoraResource",
">",
"nodeToGoodChildren",
"(",
"final",
"Node",
"input",
")",
"throws",
"RepositoryException",
"{",
"return",
"iteratorToStream",
"(",
"input",
".",
"getNodes",
"(",
"... | Get the "good" children for a node by skipping all pairtree nodes in the way.
@param input Node containing children
@return Stream of good children
@throws RepositoryException on error | [
"Get",
"the",
"good",
"children",
"for",
"a",
"node",
"by",
"skipping",
"all",
"pairtree",
"nodes",
"in",
"the",
"way",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java#L404-L409 |
102,906 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java | FedoraResourceImpl.getAllChildren | private static Stream<FedoraResource> getAllChildren(final FedoraResource resource) {
return concat(of(resource), resource.getChildren().flatMap(FedoraResourceImpl::getAllChildren));
} | java | private static Stream<FedoraResource> getAllChildren(final FedoraResource resource) {
return concat(of(resource), resource.getChildren().flatMap(FedoraResourceImpl::getAllChildren));
} | [
"private",
"static",
"Stream",
"<",
"FedoraResource",
">",
"getAllChildren",
"(",
"final",
"FedoraResource",
"resource",
")",
"{",
"return",
"concat",
"(",
"of",
"(",
"resource",
")",
",",
"resource",
".",
"getChildren",
"(",
")",
".",
"flatMap",
"(",
"Fedor... | Get all children recursively, and flatten into a single Stream. | [
"Get",
"all",
"children",
"recursively",
"and",
"flatten",
"into",
"a",
"single",
"Stream",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java#L414-L416 |
102,907 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java | FedoraResourceImpl.touch | @VisibleForTesting
public void touch(final boolean includeMembershipResource, final Calendar createdDate, final String createdUser,
final Calendar modifiedDate, final String modifyingUser) throws RepositoryException {
FedoraTypesUtils.touch(getNode(), createdDate, createdUser, modified... | java | @VisibleForTesting
public void touch(final boolean includeMembershipResource, final Calendar createdDate, final String createdUser,
final Calendar modifiedDate, final String modifyingUser) throws RepositoryException {
FedoraTypesUtils.touch(getNode(), createdDate, createdUser, modified... | [
"@",
"VisibleForTesting",
"public",
"void",
"touch",
"(",
"final",
"boolean",
"includeMembershipResource",
",",
"final",
"Calendar",
"createdDate",
",",
"final",
"String",
"createdUser",
",",
"final",
"Calendar",
"modifiedDate",
",",
"final",
"String",
"modifyingUser"... | Touches a resource to ensure that the implicitly updated properties are updated if
not explicitly set.
@param includeMembershipResource true if this touch should propagate through to
ldp membership resources
@param createdDate the date to which the created date should be set or null to leave it unchanged
@param created... | [
"Touches",
"a",
"resource",
"to",
"ensure",
"that",
"the",
"implicitly",
"updated",
"properties",
"are",
"updated",
"if",
"not",
"explicitly",
"set",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java#L1106-L1116 |
102,908 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java | FedoraResourceImpl.convertMementoReferences | protected static Function<Triple, Triple> convertMementoReferences(
final IdentifierConverter<Resource, FedoraResource> translator,
final IdentifierConverter<Resource, FedoraResource> internalTranslator) {
return t -> {
final String subjectURI = t.getSubject().getURI();
... | java | protected static Function<Triple, Triple> convertMementoReferences(
final IdentifierConverter<Resource, FedoraResource> translator,
final IdentifierConverter<Resource, FedoraResource> internalTranslator) {
return t -> {
final String subjectURI = t.getSubject().getURI();
... | [
"protected",
"static",
"Function",
"<",
"Triple",
",",
"Triple",
">",
"convertMementoReferences",
"(",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"translator",
",",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource... | Returns a function that converts the subject to the original URI and the object of a triple from an
undereferenceable internal identifier back to it's original external resource path.
If the object is not an internal identifier, the object is returned.
@param translator a converter to get the external resource identif... | [
"Returns",
"a",
"function",
"that",
"converts",
"the",
"subject",
"to",
"the",
"original",
"URI",
"and",
"the",
"object",
"of",
"a",
"triple",
"from",
"an",
"undereferenceable",
"internal",
"identifier",
"back",
"to",
"it",
"s",
"original",
"external",
"resour... | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java#L1175-L1212 |
102,909 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java | FedoraResourceImpl.dateTimeDifference | private static long dateTimeDifference(final Temporal d1, final Temporal d2) {
return ChronoUnit.SECONDS.between(d1, d2);
} | java | private static long dateTimeDifference(final Temporal d1, final Temporal d2) {
return ChronoUnit.SECONDS.between(d1, d2);
} | [
"private",
"static",
"long",
"dateTimeDifference",
"(",
"final",
"Temporal",
"d1",
",",
"final",
"Temporal",
"d2",
")",
"{",
"return",
"ChronoUnit",
".",
"SECONDS",
".",
"between",
"(",
"d1",
",",
"d2",
")",
";",
"}"
] | Calculate the difference between two datetime to the unit.
@param d1 first datetime
@param d2 second datetime
@return the difference | [
"Calculate",
"the",
"difference",
"between",
"two",
"datetime",
"to",
"the",
"unit",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java#L1339-L1341 |
102,910 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentPathValidator.java | ExternalContentPathValidator.validate | public void validate(final String extPath) throws ExternalMessageBodyException {
if (allowedList == null || allowedList.size() == 0) {
throw new ExternalMessageBodyException("External content is disallowed by the server");
}
if (isEmpty(extPath)) {
throw new ExternalMess... | java | public void validate(final String extPath) throws ExternalMessageBodyException {
if (allowedList == null || allowedList.size() == 0) {
throw new ExternalMessageBodyException("External content is disallowed by the server");
}
if (isEmpty(extPath)) {
throw new ExternalMess... | [
"public",
"void",
"validate",
"(",
"final",
"String",
"extPath",
")",
"throws",
"ExternalMessageBodyException",
"{",
"if",
"(",
"allowedList",
"==",
"null",
"||",
"allowedList",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"ExternalMessageBodyEx... | Validates that an external path is valid. The path must be an HTTP or file URI within the allow list of paths,
be absolute, and contain no relative modifier.
@param extPath external binary path to validate
@throws ExternalMessageBodyException thrown if the path is invalid. | [
"Validates",
"that",
"an",
"external",
"path",
"is",
"valid",
".",
"The",
"path",
"must",
"be",
"an",
"HTTP",
"or",
"file",
"URI",
"within",
"the",
"allow",
"list",
"of",
"paths",
"be",
"absolute",
"and",
"contain",
"no",
"relative",
"modifier",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentPathValidator.java#L70-L118 |
102,911 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentPathValidator.java | ExternalContentPathValidator.loadConfiguration | @Override
protected synchronized void loadConfiguration() throws IOException {
LOGGER.info("Loading list of allowed external content locations from {}", configPath);
try (final Stream<String> stream = Files.lines(Paths.get(configPath))) {
allowedList = stream.map(line -> normalizePath(li... | java | @Override
protected synchronized void loadConfiguration() throws IOException {
LOGGER.info("Loading list of allowed external content locations from {}", configPath);
try (final Stream<String> stream = Files.lines(Paths.get(configPath))) {
allowedList = stream.map(line -> normalizePath(li... | [
"@",
"Override",
"protected",
"synchronized",
"void",
"loadConfiguration",
"(",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Loading list of allowed external content locations from {}\"",
",",
"configPath",
")",
";",
"try",
"(",
"final",
"Stream",
... | Loads the allowed list.
@throws IOException thrown if the allowed list configuration file cannot be read. | [
"Loads",
"the",
"allowed",
"list",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentPathValidator.java#L133-L141 |
102,912 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/NamespaceTools.java | NamespaceTools.validatePath | public static void validatePath(final Session session, final String path) {
final NamespaceRegistry namespaceRegistry = getNamespaceRegistry(session);
final String[] pathSegments = path.replaceAll("^/+", "").replaceAll("/+$", "").split("/");
for (final String segment : pathSegments) {
... | java | public static void validatePath(final Session session, final String path) {
final NamespaceRegistry namespaceRegistry = getNamespaceRegistry(session);
final String[] pathSegments = path.replaceAll("^/+", "").replaceAll("/+$", "").split("/");
for (final String segment : pathSegments) {
... | [
"public",
"static",
"void",
"validatePath",
"(",
"final",
"Session",
"session",
",",
"final",
"String",
"path",
")",
"{",
"final",
"NamespaceRegistry",
"namespaceRegistry",
"=",
"getNamespaceRegistry",
"(",
"session",
")",
";",
"final",
"String",
"[",
"]",
"path... | Validate resource path for unregistered namespace prefixes
@param session the JCR session to use
@param path the absolute path to the object
@throws org.fcrepo.kernel.api.exception.FedoraInvalidNamespaceException on unregistered namespaces
@throws org.fcrepo.kernel.api.exception.RepositoryRuntimeException if repositor... | [
"Validate",
"resource",
"path",
"for",
"unregistered",
"namespace",
"prefixes"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/NamespaceTools.java#L80-L105 |
102,913 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/NamespaceTools.java | NamespaceTools.getNamespaces | public static Map<String, String> getNamespaces(final Session session) {
final NamespaceRegistry registry = getNamespaceRegistry(session);
final Map<String, String> namespaces = new HashMap<>();
try {
stream(registry.getPrefixes()).filter(internalPrefix.negate()).forEach(x -> {
... | java | public static Map<String, String> getNamespaces(final Session session) {
final NamespaceRegistry registry = getNamespaceRegistry(session);
final Map<String, String> namespaces = new HashMap<>();
try {
stream(registry.getPrefixes()).filter(internalPrefix.negate()).forEach(x -> {
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getNamespaces",
"(",
"final",
"Session",
"session",
")",
"{",
"final",
"NamespaceRegistry",
"registry",
"=",
"getNamespaceRegistry",
"(",
"session",
")",
";",
"final",
"Map",
"<",
"String",
",",
... | Retrieve the namespaces as a Map
@param session the JCR session to use
@return a mapping of the prefix to URI | [
"Retrieve",
"the",
"namespaces",
"as",
"a",
"Map"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/NamespaceTools.java#L113-L129 |
102,914 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/RdfStreamStreamingOutput.java | RdfStreamStreamingOutput.filterNamespacesToPresent | private static Map<String, String> filterNamespacesToPresent(final Model model,
final Map<String, String> nsPrefixes) {
final Map<String, String> resultNses = new HashMap<>();
final Set<Entry<String, String>> nsSet = nsPrefixes.entrySet();
final NsIterator nsIt = model.listNameSpaces... | java | private static Map<String, String> filterNamespacesToPresent(final Model model,
final Map<String, String> nsPrefixes) {
final Map<String, String> resultNses = new HashMap<>();
final Set<Entry<String, String>> nsSet = nsPrefixes.entrySet();
final NsIterator nsIt = model.listNameSpaces... | [
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"filterNamespacesToPresent",
"(",
"final",
"Model",
"model",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"nsPrefixes",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
... | Filters the map of namespace prefix mappings to just those containing namespace URIs present in the model
@param model model
@param nsPrefixes map of namespace to uris
@return nsPrefixes filtered to namespaces found in the model | [
"Filters",
"the",
"map",
"of",
"namespace",
"prefix",
"mappings",
"to",
"just",
"those",
"containing",
"namespace",
"URIs",
"present",
"in",
"the",
"model"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/RdfStreamStreamingOutput.java#L208-L226 |
102,915 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/repository/FedoraRepositoryBackup.java | FedoraRepositoryBackup.runBackup | @POST
public Response runBackup(final InputStream bodyStream) throws IOException {
File backupDirectory;
if (null != bodyStream) {
final String body = IOUtils.toString(bodyStream).trim();
backupDirectory = new File(body.trim());
if (body.isEmpty()) {
... | java | @POST
public Response runBackup(final InputStream bodyStream) throws IOException {
File backupDirectory;
if (null != bodyStream) {
final String body = IOUtils.toString(bodyStream).trim();
backupDirectory = new File(body.trim());
if (body.isEmpty()) {
... | [
"@",
"POST",
"public",
"Response",
"runBackup",
"(",
"final",
"InputStream",
"bodyStream",
")",
"throws",
"IOException",
"{",
"File",
"backupDirectory",
";",
"if",
"(",
"null",
"!=",
"bodyStream",
")",
"{",
"final",
"String",
"body",
"=",
"IOUtils",
".",
"to... | This method runs a repository backup.
@param bodyStream the input body stream
@return path to the backup
@throws IOException if IO exception occurred | [
"This",
"method",
"runs",
"a",
"repository",
"backup",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/repository/FedoraRepositoryBackup.java#L72-L114 |
102,916 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/rdf/RdfNamespaceRegistry.java | RdfNamespaceRegistry.loadConfiguration | @Override
protected synchronized void loadConfiguration() throws IOException {
final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
final TypeReference<HashMap<String, String>> typeRef = new TypeReference<HashMap<String, String>>() {};
namespaces = mapper.readValue(new File(confi... | java | @Override
protected synchronized void loadConfiguration() throws IOException {
final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
final TypeReference<HashMap<String, String>> typeRef = new TypeReference<HashMap<String, String>>() {};
namespaces = mapper.readValue(new File(confi... | [
"@",
"Override",
"protected",
"synchronized",
"void",
"loadConfiguration",
"(",
")",
"throws",
"IOException",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
"new",
"YAMLFactory",
"(",
")",
")",
";",
"final",
"TypeReference",
"<",
"HashM... | Load the namespace prefix to URI configuration file | [
"Load",
"the",
"namespace",
"prefix",
"to",
"URI",
"configuration",
"file"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/rdf/RdfNamespaceRegistry.java#L43-L48 |
102,917 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/responses/StreamingBaseHtmlProvider.java | StreamingBaseHtmlProvider.getResourceFromSubject | private FedoraResource getResourceFromSubject(final String subjectUri) {
final UriTemplate uriTemplate =
new UriTemplate(uriInfo.getBaseUriBuilder().clone().path(FedoraLdp.class).toTemplate());
final Map<String, String> values = new HashMap<>();
uriTemplate.match(subjectUri, values);... | java | private FedoraResource getResourceFromSubject(final String subjectUri) {
final UriTemplate uriTemplate =
new UriTemplate(uriInfo.getBaseUriBuilder().clone().path(FedoraLdp.class).toTemplate());
final Map<String, String> values = new HashMap<>();
uriTemplate.match(subjectUri, values);... | [
"private",
"FedoraResource",
"getResourceFromSubject",
"(",
"final",
"String",
"subjectUri",
")",
"{",
"final",
"UriTemplate",
"uriTemplate",
"=",
"new",
"UriTemplate",
"(",
"uriInfo",
".",
"getBaseUriBuilder",
"(",
")",
".",
"clone",
"(",
")",
".",
"path",
"(",... | Get a FedoraResource for the subject of the graph, if it exists.
@param subjectUri the uri of the subject
@return FedoraResource if exists or null | [
"Get",
"a",
"FedoraResource",
"for",
"the",
"subject",
"of",
"the",
"graph",
"if",
"it",
"exists",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/responses/StreamingBaseHtmlProvider.java#L211-L230 |
102,918 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/spring/ModeShapeRepositoryFactoryBean.java | ModeShapeRepositoryFactoryBean.buildRepository | @PostConstruct
public void buildRepository() {
try {
LOGGER.info("Using repo config (classpath): {}", repositoryConfiguration.getURL());
getPropertiesLoader().loadSystemProperties();
final RepositoryConfiguration config =
RepositoryConfiguration.read(... | java | @PostConstruct
public void buildRepository() {
try {
LOGGER.info("Using repo config (classpath): {}", repositoryConfiguration.getURL());
getPropertiesLoader().loadSystemProperties();
final RepositoryConfiguration config =
RepositoryConfiguration.read(... | [
"@",
"PostConstruct",
"public",
"void",
"buildRepository",
"(",
")",
"{",
"try",
"{",
"LOGGER",
".",
"info",
"(",
"\"Using repo config (classpath): {}\"",
",",
"repositoryConfiguration",
".",
"getURL",
"(",
")",
")",
";",
"getPropertiesLoader",
"(",
")",
".",
"l... | Generate a JCR repository from the given configuration | [
"Generate",
"a",
"JCR",
"repository",
"from",
"the",
"given",
"configuration"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/spring/ModeShapeRepositoryFactoryBean.java#L68-L88 |
102,919 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/spring/ModeShapeRepositoryFactoryBean.java | ModeShapeRepositoryFactoryBean.stopRepository | @PreDestroy
public void stopRepository() throws InterruptedException {
LOGGER.info("Initiating shutdown of ModeShape");
final String repoName = repository.getName();
try {
final Future<Boolean> futureUndeployRepo = modeShapeEngine.undeploy(repoName);
if (futureUndeplo... | java | @PreDestroy
public void stopRepository() throws InterruptedException {
LOGGER.info("Initiating shutdown of ModeShape");
final String repoName = repository.getName();
try {
final Future<Boolean> futureUndeployRepo = modeShapeEngine.undeploy(repoName);
if (futureUndeplo... | [
"@",
"PreDestroy",
"public",
"void",
"stopRepository",
"(",
")",
"throws",
"InterruptedException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Initiating shutdown of ModeShape\"",
")",
";",
"final",
"String",
"repoName",
"=",
"repository",
".",
"getName",
"(",
")",
";",
... | Attempts to undeploy the repository and shutdown the ModeShape engine on
context destroy.
@throws InterruptedException if interrupted exception occurred | [
"Attempts",
"to",
"undeploy",
"the",
"repository",
"and",
"shutdown",
"the",
"ModeShape",
"engine",
"on",
"context",
"destroy",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/spring/ModeShapeRepositoryFactoryBean.java#L96-L123 |
102,920 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/ServiceHelpers.java | ServiceHelpers.getNodePropertySize | private static Long getNodePropertySize(final Node node)
throws RepositoryException {
Long size = 0L;
for (final PropertyIterator i = node.getProperties(); i.hasNext();) {
final Property p = i.nextProperty();
if (p.isMultiple()) {
for (final Value v : p.ge... | java | private static Long getNodePropertySize(final Node node)
throws RepositoryException {
Long size = 0L;
for (final PropertyIterator i = node.getProperties(); i.hasNext();) {
final Property p = i.nextProperty();
if (p.isMultiple()) {
for (final Value v : p.ge... | [
"private",
"static",
"Long",
"getNodePropertySize",
"(",
"final",
"Node",
"node",
")",
"throws",
"RepositoryException",
"{",
"Long",
"size",
"=",
"0L",
";",
"for",
"(",
"final",
"PropertyIterator",
"i",
"=",
"node",
".",
"getProperties",
"(",
")",
";",
"i",
... | Get the total size of a Node's properties
@param node the node
@return size in bytes
@throws RepositoryException if repository exception occurred | [
"Get",
"the",
"total",
"size",
"of",
"a",
"Node",
"s",
"properties"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/ServiceHelpers.java#L62-L76 |
102,921 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/ServiceHelpers.java | ServiceHelpers.getContentSize | private static Long getContentSize(final Node ds) {
try {
long size = 0L;
if (ds.hasNode(JCR_CONTENT)) {
final Node contentNode = ds.getNode(JCR_CONTENT);
if (contentNode.hasProperty(JCR_DATA)) {
size =
ds.g... | java | private static Long getContentSize(final Node ds) {
try {
long size = 0L;
if (ds.hasNode(JCR_CONTENT)) {
final Node contentNode = ds.getNode(JCR_CONTENT);
if (contentNode.hasProperty(JCR_DATA)) {
size =
ds.g... | [
"private",
"static",
"Long",
"getContentSize",
"(",
"final",
"Node",
"ds",
")",
"{",
"try",
"{",
"long",
"size",
"=",
"0L",
";",
"if",
"(",
"ds",
".",
"hasNode",
"(",
"JCR_CONTENT",
")",
")",
"{",
"final",
"Node",
"contentNode",
"=",
"ds",
".",
"getN... | Get the size of the JCR content binary property
@param ds the given node
@return size of the binary content property | [
"Get",
"the",
"size",
"of",
"the",
"JCR",
"content",
"binary",
"property"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/ServiceHelpers.java#L123-L141 |
102,922 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraTransactions.java | FedoraTransactions.createTransaction | @POST
public Response createTransaction(@PathParam("path") final String externalPath) throws URISyntaxException {
if (batchService.exists(session.getId(), getUserPrincipal())) {
LOGGER.debug("renewing transaction {}", session.getId());
batchService.refresh(session.getId(), getUserPr... | java | @POST
public Response createTransaction(@PathParam("path") final String externalPath) throws URISyntaxException {
if (batchService.exists(session.getId(), getUserPrincipal())) {
LOGGER.debug("renewing transaction {}", session.getId());
batchService.refresh(session.getId(), getUserPr... | [
"@",
"POST",
"public",
"Response",
"createTransaction",
"(",
"@",
"PathParam",
"(",
"\"path\"",
")",
"final",
"String",
"externalPath",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"batchService",
".",
"exists",
"(",
"session",
".",
"getId",
"(",
")",
... | Create a new transaction resource and add it to the registry
@param externalPath the external path
@return 201 with the transaction id and expiration date
@throws URISyntaxException if URI syntax exception occurred | [
"Create",
"a",
"new",
"transaction",
"resource",
"and",
"add",
"it",
"to",
"the",
"registry"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraTransactions.java#L62-L89 |
102,923 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraTransactions.java | FedoraTransactions.commit | @POST
@Path("fcr:commit")
public Response commit(@PathParam("path") final String externalPath) {
LOGGER.info("Commit transaction '{}'", externalPath);
return finalizeTransaction(externalPath, getUserPrincipal(), true);
} | java | @POST
@Path("fcr:commit")
public Response commit(@PathParam("path") final String externalPath) {
LOGGER.info("Commit transaction '{}'", externalPath);
return finalizeTransaction(externalPath, getUserPrincipal(), true);
} | [
"@",
"POST",
"@",
"Path",
"(",
"\"fcr:commit\"",
")",
"public",
"Response",
"commit",
"(",
"@",
"PathParam",
"(",
"\"path\"",
")",
"final",
"String",
"externalPath",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Commit transaction '{}'\"",
",",
"externalPath",
")",... | Commit a transaction resource
@param externalPath the external path
@return 204 | [
"Commit",
"a",
"transaction",
"resource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraTransactions.java#L97-L102 |
102,924 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraTransactions.java | FedoraTransactions.rollback | @POST
@Path("fcr:rollback")
public Response rollback(@PathParam("path") final String externalPath) {
LOGGER.info("Rollback transaction '{}'", externalPath);
return finalizeTransaction(externalPath, getUserPrincipal(), false);
} | java | @POST
@Path("fcr:rollback")
public Response rollback(@PathParam("path") final String externalPath) {
LOGGER.info("Rollback transaction '{}'", externalPath);
return finalizeTransaction(externalPath, getUserPrincipal(), false);
} | [
"@",
"POST",
"@",
"Path",
"(",
"\"fcr:rollback\"",
")",
"public",
"Response",
"rollback",
"(",
"@",
"PathParam",
"(",
"\"path\"",
")",
"final",
"String",
"externalPath",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Rollback transaction '{}'\"",
",",
"externalPath",
... | Rollback a transaction
@param externalPath the external path
@return 204 | [
"Rollback",
"a",
"transaction"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraTransactions.java#L110-L116 |
102,925 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraSessionImpl.java | FedoraSessionImpl.getJcrSession | public static Session getJcrSession(final FedoraSession session) {
if (session instanceof FedoraSessionImpl) {
return ((FedoraSessionImpl)session).getJcrSession();
}
throw new ClassCastException("FedoraSession is not a " + FedoraSessionImpl.class.getCanonicalName());
} | java | public static Session getJcrSession(final FedoraSession session) {
if (session instanceof FedoraSessionImpl) {
return ((FedoraSessionImpl)session).getJcrSession();
}
throw new ClassCastException("FedoraSession is not a " + FedoraSessionImpl.class.getCanonicalName());
} | [
"public",
"static",
"Session",
"getJcrSession",
"(",
"final",
"FedoraSession",
"session",
")",
"{",
"if",
"(",
"session",
"instanceof",
"FedoraSessionImpl",
")",
"{",
"return",
"(",
"(",
"FedoraSessionImpl",
")",
"session",
")",
".",
"getJcrSession",
"(",
")",
... | Get the internal JCR session from an existing FedoraSession
@param session the FedoraSession
@return the JCR session | [
"Get",
"the",
"internal",
"JCR",
"session",
"from",
"an",
"existing",
"FedoraSession"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraSessionImpl.java#L166-L171 |
102,926 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/SubjectMappingUtil.java | SubjectMappingUtil.mapSubject | public static Triple mapSubject(final Triple t, final String resourceUri, final String destinationUri) {
final Node destinationNode = createURI(destinationUri);
return mapSubject(t, resourceUri, destinationNode);
} | java | public static Triple mapSubject(final Triple t, final String resourceUri, final String destinationUri) {
final Node destinationNode = createURI(destinationUri);
return mapSubject(t, resourceUri, destinationNode);
} | [
"public",
"static",
"Triple",
"mapSubject",
"(",
"final",
"Triple",
"t",
",",
"final",
"String",
"resourceUri",
",",
"final",
"String",
"destinationUri",
")",
"{",
"final",
"Node",
"destinationNode",
"=",
"createURI",
"(",
"destinationUri",
")",
";",
"return",
... | Maps the subject of t from resourceUri to destinationUri to produce a new Triple.
If the triple does not have the subject resourceUri, then the triple is unchanged.
@param t triple to be remapped.
@param resourceUri resource subject uri to be remapped.
@param destinationUri subject uri for the resultant triple.
@retur... | [
"Maps",
"the",
"subject",
"of",
"t",
"from",
"resourceUri",
"to",
"destinationUri",
"to",
"produce",
"a",
"new",
"Triple",
".",
"If",
"the",
"triple",
"does",
"not",
"have",
"the",
"subject",
"resourceUri",
"then",
"the",
"triple",
"is",
"unchanged",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/SubjectMappingUtil.java#L45-L48 |
102,927 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/SubjectMappingUtil.java | SubjectMappingUtil.mapSubject | public static Triple mapSubject(final Triple t, final String resourceUri, final Node destinationNode) {
final Node tripleSubj = t.getSubject();
final String tripleSubjUri = tripleSubj.getURI();
final Node subject;
if (tripleSubjUri.equals(resourceUri)) {
subject = destination... | java | public static Triple mapSubject(final Triple t, final String resourceUri, final Node destinationNode) {
final Node tripleSubj = t.getSubject();
final String tripleSubjUri = tripleSubj.getURI();
final Node subject;
if (tripleSubjUri.equals(resourceUri)) {
subject = destination... | [
"public",
"static",
"Triple",
"mapSubject",
"(",
"final",
"Triple",
"t",
",",
"final",
"String",
"resourceUri",
",",
"final",
"Node",
"destinationNode",
")",
"{",
"final",
"Node",
"tripleSubj",
"=",
"t",
".",
"getSubject",
"(",
")",
";",
"final",
"String",
... | Maps the subject of t from resourceUri to destinationNode to produce a new Triple.
If the triple does not have the subject resourceUri, then the triple is unchanged.
@param t triple to be remapped.
@param resourceUri resource subject uri to be remapped.
@param destinationNode subject node for the resultant triple.
@re... | [
"Maps",
"the",
"subject",
"of",
"t",
"from",
"resourceUri",
"to",
"destinationNode",
"to",
"produce",
"a",
"new",
"Triple",
".",
"If",
"the",
"triple",
"does",
"not",
"have",
"the",
"subject",
"resourceUri",
"then",
"the",
"triple",
"is",
"unchanged",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/SubjectMappingUtil.java#L59-L74 |
102,928 | fcrepo4/fcrepo4 | fcrepo-event-serialization/src/main/java/org/fcrepo/event/serialization/TurtleSerializer.java | TurtleSerializer.serialize | @Override
public String serialize(final FedoraEvent evt) {
try {
final Model model = EventSerializer.toModel(evt);
final ByteArrayOutputStream out = new ByteArrayOutputStream();
model.write(out, "TTL");
return out.toString("UTF-8");
} catch (final Unsu... | java | @Override
public String serialize(final FedoraEvent evt) {
try {
final Model model = EventSerializer.toModel(evt);
final ByteArrayOutputStream out = new ByteArrayOutputStream();
model.write(out, "TTL");
return out.toString("UTF-8");
} catch (final Unsu... | [
"@",
"Override",
"public",
"String",
"serialize",
"(",
"final",
"FedoraEvent",
"evt",
")",
"{",
"try",
"{",
"final",
"Model",
"model",
"=",
"EventSerializer",
".",
"toModel",
"(",
"evt",
")",
";",
"final",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArr... | Serialize a FedoraEvent in RDF using Turtle syntax
@param evt the Fedora event
@return a string of RDF, using Turtle syntax | [
"Serialize",
"a",
"FedoraEvent",
"in",
"RDF",
"using",
"Turtle",
"syntax"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-event-serialization/src/main/java/org/fcrepo/event/serialization/TurtleSerializer.java#L39-L49 |
102,929 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/exceptionhandlers/ConstraintExceptionMapper.java | ConstraintExceptionMapper.buildConstraintLink | public static Link buildConstraintLink(final ConstraintViolationException e,
final ServletContext context,
final UriInfo uriInfo) {
String path = context.getContextPath();
if (path.equals("/")) {
path = ""... | java | public static Link buildConstraintLink(final ConstraintViolationException e,
final ServletContext context,
final UriInfo uriInfo) {
String path = context.getContextPath();
if (path.equals("/")) {
path = ""... | [
"public",
"static",
"Link",
"buildConstraintLink",
"(",
"final",
"ConstraintViolationException",
"e",
",",
"final",
"ServletContext",
"context",
",",
"final",
"UriInfo",
"uriInfo",
")",
"{",
"String",
"path",
"=",
"context",
".",
"getContextPath",
"(",
")",
";",
... | Creates a constrainedBy link header with the appropriate RDF URL for the exception.
@param e ConstraintViolationException Exception which implements the buildContraintUri method.
@param context ServletContext ServletContext that we're running in.
@param uriInfo UriInfo UriInfo from the ExceptionMapper.
@return Link A ... | [
"Creates",
"a",
"constrainedBy",
"link",
"header",
"with",
"the",
"appropriate",
"RDF",
"URL",
"for",
"the",
"exception",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/exceptionhandlers/ConstraintExceptionMapper.java#L51-L64 |
102,930 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.getPropertyType | public static Optional<Integer> getPropertyType(final Node node, final String propertyName)
throws RepositoryException {
LOGGER.debug("Getting type of property: {} from node: {}", propertyName, node);
return getDefinitionForPropertyName(node, propertyName).map(PropertyDefinition::getRequired... | java | public static Optional<Integer> getPropertyType(final Node node, final String propertyName)
throws RepositoryException {
LOGGER.debug("Getting type of property: {} from node: {}", propertyName, node);
return getDefinitionForPropertyName(node, propertyName).map(PropertyDefinition::getRequired... | [
"public",
"static",
"Optional",
"<",
"Integer",
">",
"getPropertyType",
"(",
"final",
"Node",
"node",
",",
"final",
"String",
"propertyName",
")",
"throws",
"RepositoryException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Getting type of property: {} from node: {}\"",
",",... | Get the JCR property type ID for a given property name. If unsure, mark
it as UNDEFINED.
@param node the JCR node to add the property on
@param propertyName the property name
@return a PropertyType value
@throws RepositoryException if repository exception occurred | [
"Get",
"the",
"JCR",
"property",
"type",
"ID",
"for",
"a",
"given",
"property",
"name",
".",
"If",
"unsure",
"mark",
"it",
"as",
"UNDEFINED",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L258-L262 |
102,931 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.getReferencePropertyOriginalName | public static String getReferencePropertyOriginalName(final String refPropertyName) {
final int i = refPropertyName.lastIndexOf(REFERENCE_PROPERTY_SUFFIX);
return i < 0 ? refPropertyName : refPropertyName.substring(0, i);
} | java | public static String getReferencePropertyOriginalName(final String refPropertyName) {
final int i = refPropertyName.lastIndexOf(REFERENCE_PROPERTY_SUFFIX);
return i < 0 ? refPropertyName : refPropertyName.substring(0, i);
} | [
"public",
"static",
"String",
"getReferencePropertyOriginalName",
"(",
"final",
"String",
"refPropertyName",
")",
"{",
"final",
"int",
"i",
"=",
"refPropertyName",
".",
"lastIndexOf",
"(",
"REFERENCE_PROPERTY_SUFFIX",
")",
";",
"return",
"i",
"<",
"0",
"?",
"refPr... | Given an internal reference node property, get the original name
@param refPropertyName the reference node property name
@return original property name of the reference property | [
"Given",
"an",
"internal",
"reference",
"node",
"property",
"get",
"the",
"original",
"name"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L313-L316 |
102,932 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.isReferenceProperty | public static boolean isReferenceProperty(final Node node, final String propertyName) throws RepositoryException {
final Optional<PropertyDefinition> propertyDefinition = getDefinitionForPropertyName(node, propertyName);
return propertyDefinition.isPresent() &&
(propertyDefinition.get()... | java | public static boolean isReferenceProperty(final Node node, final String propertyName) throws RepositoryException {
final Optional<PropertyDefinition> propertyDefinition = getDefinitionForPropertyName(node, propertyName);
return propertyDefinition.isPresent() &&
(propertyDefinition.get()... | [
"public",
"static",
"boolean",
"isReferenceProperty",
"(",
"final",
"Node",
"node",
",",
"final",
"String",
"propertyName",
")",
"throws",
"RepositoryException",
"{",
"final",
"Optional",
"<",
"PropertyDefinition",
">",
"propertyDefinition",
"=",
"getDefinitionForProper... | Check if a property definition is a reference property
@param node the given node
@param propertyName the property name
@return whether a property definition is a reference property
@throws RepositoryException if repository exception occurred | [
"Check",
"if",
"a",
"property",
"definition",
"is",
"a",
"reference",
"property"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L325-L331 |
102,933 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.getClosestExistingAncestor | public static Node getClosestExistingAncestor(final Session session, final String path)
throws RepositoryException {
String potentialPath = path.startsWith("/") ? path : "/" + path;
while (!potentialPath.isEmpty()) {
if (session.nodeExists(potentialPath)) {
retur... | java | public static Node getClosestExistingAncestor(final Session session, final String path)
throws RepositoryException {
String potentialPath = path.startsWith("/") ? path : "/" + path;
while (!potentialPath.isEmpty()) {
if (session.nodeExists(potentialPath)) {
retur... | [
"public",
"static",
"Node",
"getClosestExistingAncestor",
"(",
"final",
"Session",
"session",
",",
"final",
"String",
"path",
")",
"throws",
"RepositoryException",
"{",
"String",
"potentialPath",
"=",
"path",
".",
"startsWith",
"(",
"\"/\"",
")",
"?",
"path",
":... | Get the closest ancestor that current exists
@param session the given session
@param path the given path
@return the closest ancestor that current exists
@throws RepositoryException if repository exception occurred | [
"Get",
"the",
"closest",
"ancestor",
"that",
"current",
"exists"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L342-L353 |
102,934 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.getJcrNode | public static Node getJcrNode(final FedoraResource resource) {
if (resource instanceof FedoraResourceImpl) {
return ((FedoraResourceImpl)resource).getNode();
}
throw new IllegalArgumentException("FedoraResource is of the wrong type");
} | java | public static Node getJcrNode(final FedoraResource resource) {
if (resource instanceof FedoraResourceImpl) {
return ((FedoraResourceImpl)resource).getNode();
}
throw new IllegalArgumentException("FedoraResource is of the wrong type");
} | [
"public",
"static",
"Node",
"getJcrNode",
"(",
"final",
"FedoraResource",
"resource",
")",
"{",
"if",
"(",
"resource",
"instanceof",
"FedoraResourceImpl",
")",
"{",
"return",
"(",
"(",
"FedoraResourceImpl",
")",
"resource",
")",
".",
"getNode",
"(",
")",
";",
... | Retrieve the underlying JCR Node from the FedoraResource
@param resource the Fedora resource
@return the JCR Node | [
"Retrieve",
"the",
"underlying",
"JCR",
"Node",
"from",
"the",
"FedoraResource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L361-L366 |
102,935 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.resourceToProperty | public static Function<Resource, Optional<String>> resourceToProperty(final Session session) {
return resource -> {
try {
final NamespaceRegistry registry = getNamespaceRegistry(session);
return Optional.of(registry.getPrefix(resource.getNameSpace()) + ":" + resource.... | java | public static Function<Resource, Optional<String>> resourceToProperty(final Session session) {
return resource -> {
try {
final NamespaceRegistry registry = getNamespaceRegistry(session);
return Optional.of(registry.getPrefix(resource.getNameSpace()) + ":" + resource.... | [
"public",
"static",
"Function",
"<",
"Resource",
",",
"Optional",
"<",
"String",
">",
">",
"resourceToProperty",
"(",
"final",
"Session",
"session",
")",
"{",
"return",
"resource",
"->",
"{",
"try",
"{",
"final",
"NamespaceRegistry",
"registry",
"=",
"getNames... | Using a JCR session, return a function that maps an RDF Resource to a corresponding property name.
@param session The JCR session
@return a Function that maps a Resource to an Optional-wrapped String | [
"Using",
"a",
"JCR",
"session",
"return",
"a",
"function",
"that",
"maps",
"an",
"RDF",
"Resource",
"to",
"a",
"corresponding",
"property",
"name",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L388-L398 |
102,936 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.touch | private static void touch(final Node node, final Calendar modified, final String modifyingUser) {
touch(node, null, null, modified, modifyingUser);
} | java | private static void touch(final Node node, final Calendar modified, final String modifyingUser) {
touch(node, null, null, modified, modifyingUser);
} | [
"private",
"static",
"void",
"touch",
"(",
"final",
"Node",
"node",
",",
"final",
"Calendar",
"modified",
",",
"final",
"String",
"modifyingUser",
")",
"{",
"touch",
"(",
"node",
",",
"null",
",",
"null",
",",
"modified",
",",
"modifyingUser",
")",
";",
... | Updates the LAST_MODIFIED_DATE and LAST_MODIFIED_BY properties to the provided values.
@param node The JCR node
@param modified the modification date, or null if not explicitly set
@param modifyingUser the userID who modified this resource or null if not explicitly set | [
"Updates",
"the",
"LAST_MODIFIED_DATE",
"and",
"LAST_MODIFIED_BY",
"properties",
"to",
"the",
"provided",
"values",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L454-L456 |
102,937 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.touch | public static void touch(final Node node, final Calendar created, final String creatingUser,
final Calendar modified, final String modifyingUser) {
try {
if (created != null) {
node.setProperty(FEDORA_CREATED, created);
}
if (crea... | java | public static void touch(final Node node, final Calendar created, final String creatingUser,
final Calendar modified, final String modifyingUser) {
try {
if (created != null) {
node.setProperty(FEDORA_CREATED, created);
}
if (crea... | [
"public",
"static",
"void",
"touch",
"(",
"final",
"Node",
"node",
",",
"final",
"Calendar",
"created",
",",
"final",
"String",
"creatingUser",
",",
"final",
"Calendar",
"modified",
",",
"final",
"String",
"modifyingUser",
")",
"{",
"try",
"{",
"if",
"(",
... | Updates the LAST_MODIFIED_DATE, LAST_MODIFIED_BY, CREATED_DATE and CREATED_BY properties to the provided values.
@param node The JCR node
@param created the date the resource was created, or null if not explicitly set
@param creatingUser the userID of created this resource or null if not explicitly set
@param modified... | [
"Updates",
"the",
"LAST_MODIFIED_DATE",
"LAST_MODIFIED_BY",
"CREATED_DATE",
"and",
"CREATED_BY",
"properties",
"to",
"the",
"provided",
"values",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L468-L498 |
102,938 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.getContainingNode | public static Optional<Node> getContainingNode(final Node node) {
try {
if (node.getDepth() == 0) {
return empty();
}
// check ancestors recursively only either of the following two cases applies:
// 1. the PARENT is a FEDORA_PAIRTREE
... | java | public static Optional<Node> getContainingNode(final Node node) {
try {
if (node.getDepth() == 0) {
return empty();
}
// check ancestors recursively only either of the following two cases applies:
// 1. the PARENT is a FEDORA_PAIRTREE
... | [
"public",
"static",
"Optional",
"<",
"Node",
">",
"getContainingNode",
"(",
"final",
"Node",
"node",
")",
"{",
"try",
"{",
"if",
"(",
"node",
".",
"getDepth",
"(",
")",
"==",
"0",
")",
"{",
"return",
"empty",
"(",
")",
";",
"}",
"// check ancestors rec... | Get the JCR Node that corresponds to the containing node in the repository.
This may be the direct parent node, but it may also be a more distant ancestor.
@param node the JCR node
@return the containing node, if one is present | [
"Get",
"the",
"JCR",
"Node",
"that",
"corresponds",
"to",
"the",
"containing",
"node",
"in",
"the",
"repository",
".",
"This",
"may",
"be",
"the",
"direct",
"parent",
"node",
"but",
"it",
"may",
"also",
"be",
"a",
"more",
"distant",
"ancestor",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L507-L524 |
102,939 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/FedoraEventImpl.java | FedoraEventImpl.valueOf | public static EventType valueOf(final Integer i) {
final EventType type = translation.get(i);
if (isNull(type)) {
throw new IllegalArgumentException("Invalid event type: " + i);
}
return type;
} | java | public static EventType valueOf(final Integer i) {
final EventType type = translation.get(i);
if (isNull(type)) {
throw new IllegalArgumentException("Invalid event type: " + i);
}
return type;
} | [
"public",
"static",
"EventType",
"valueOf",
"(",
"final",
"Integer",
"i",
")",
"{",
"final",
"EventType",
"type",
"=",
"translation",
".",
"get",
"(",
"i",
")",
";",
"if",
"(",
"isNull",
"(",
"type",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Get the Fedora event type for a JCR type
@param i the integer value of a JCR type
@return EventType | [
"Get",
"the",
"Fedora",
"event",
"type",
"for",
"a",
"JCR",
"type"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/FedoraEventImpl.java#L235-L241 |
102,940 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/FedoraEventImpl.java | FedoraEventImpl.from | public static FedoraEvent from(final Event event) {
requireNonNull(event);
try {
@SuppressWarnings("unchecked")
final Map<String, String> info = new HashMap<>(event.getInfo());
final String userdata = event.getUserData();
try {
if (userdat... | java | public static FedoraEvent from(final Event event) {
requireNonNull(event);
try {
@SuppressWarnings("unchecked")
final Map<String, String> info = new HashMap<>(event.getInfo());
final String userdata = event.getUserData();
try {
if (userdat... | [
"public",
"static",
"FedoraEvent",
"from",
"(",
"final",
"Event",
"event",
")",
"{",
"requireNonNull",
"(",
"event",
")",
";",
"try",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"info",
"=",
... | Convert a JCR Event to a FedoraEvent
@param event the JCR Event
@return a FedoraEvent | [
"Convert",
"a",
"JCR",
"Event",
"to",
"a",
"FedoraEvent"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/FedoraEventImpl.java#L249-L285 |
102,941 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/FedoraEventImpl.java | FedoraEventImpl.getResourceTypes | public static Stream<String> getResourceTypes(final Event event) {
if (event instanceof org.modeshape.jcr.api.observation.Event) {
try {
final org.modeshape.jcr.api.observation.Event modeEvent =
(org.modeshape.jcr.api.observation.Event) event;
... | java | public static Stream<String> getResourceTypes(final Event event) {
if (event instanceof org.modeshape.jcr.api.observation.Event) {
try {
final org.modeshape.jcr.api.observation.Event modeEvent =
(org.modeshape.jcr.api.observation.Event) event;
... | [
"public",
"static",
"Stream",
"<",
"String",
">",
"getResourceTypes",
"(",
"final",
"Event",
"event",
")",
"{",
"if",
"(",
"event",
"instanceof",
"org",
".",
"modeshape",
".",
"jcr",
".",
"api",
".",
"observation",
".",
"Event",
")",
"{",
"try",
"{",
"... | Get the RDF Types of the resource corresponding to this JCR Event
@param event the JCR event
@return the types recorded on the resource associated to this event | [
"Get",
"the",
"RDF",
"Types",
"of",
"the",
"resource",
"corresponding",
"to",
"this",
"JCR",
"Event"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/FedoraEventImpl.java#L292-L308 |
102,942 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/ExternalContentServiceImpl.java | ExternalContentServiceImpl.retrieveExternalContent | @SuppressWarnings("resource")
@Override
public InputStream retrieveExternalContent(final URI sourceUri) throws IOException {
final HttpGet httpGet = new HttpGet(sourceUri);
final CloseableHttpClient client = getCloseableHttpClient();
final HttpResponse response = client.execute(httpGet);... | java | @SuppressWarnings("resource")
@Override
public InputStream retrieveExternalContent(final URI sourceUri) throws IOException {
final HttpGet httpGet = new HttpGet(sourceUri);
final CloseableHttpClient client = getCloseableHttpClient();
final HttpResponse response = client.execute(httpGet);... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"@",
"Override",
"public",
"InputStream",
"retrieveExternalContent",
"(",
"final",
"URI",
"sourceUri",
")",
"throws",
"IOException",
"{",
"final",
"HttpGet",
"httpGet",
"=",
"new",
"HttpGet",
"(",
"sourceUri",
")"... | Retrieve the content at the URI using the global connection pool.
@param sourceUri the source uri
@return the content at the URI using the global connection pool
@throws IOException if IO exception occurred | [
"Retrieve",
"the",
"content",
"at",
"the",
"URI",
"using",
"the",
"global",
"connection",
"pool",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/ExternalContentServiceImpl.java#L50-L57 |
102,943 | aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.toBean | public static Object toBean( JSONObject jsonObject ) {
if( jsonObject == null || jsonObject.isNullObject() ){
return null;
}
DynaBean dynaBean = null;
JsonConfig jsonConfig = new JsonConfig();
Map props = JSONUtils.getProperties( jsonObject );
dynaBean = JSONUtils.newDynaB... | java | public static Object toBean( JSONObject jsonObject ) {
if( jsonObject == null || jsonObject.isNullObject() ){
return null;
}
DynaBean dynaBean = null;
JsonConfig jsonConfig = new JsonConfig();
Map props = JSONUtils.getProperties( jsonObject );
dynaBean = JSONUtils.newDynaB... | [
"public",
"static",
"Object",
"toBean",
"(",
"JSONObject",
"jsonObject",
")",
"{",
"if",
"(",
"jsonObject",
"==",
"null",
"||",
"jsonObject",
".",
"isNullObject",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"DynaBean",
"dynaBean",
"=",
"null",
";",
"... | Creates a JSONDynaBean from a JSONObject. | [
"Creates",
"a",
"JSONDynaBean",
"from",
"a",
"JSONObject",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L168-L214 |
102,944 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JavaIdentifierTransformer.java | JavaIdentifierTransformer.shaveOffNonJavaIdentifierStartChars | protected final String shaveOffNonJavaIdentifierStartChars( String str ) {
String str2 = str;
// shave off first char if not valid
boolean ready = false;
while( !ready ){
if( !Character.isJavaIdentifierStart( str2.charAt( 0 ) ) ){
str2 = str2.substring( 1 );
if( ... | java | protected final String shaveOffNonJavaIdentifierStartChars( String str ) {
String str2 = str;
// shave off first char if not valid
boolean ready = false;
while( !ready ){
if( !Character.isJavaIdentifierStart( str2.charAt( 0 ) ) ){
str2 = str2.substring( 1 );
if( ... | [
"protected",
"final",
"String",
"shaveOffNonJavaIdentifierStartChars",
"(",
"String",
"str",
")",
"{",
"String",
"str2",
"=",
"str",
";",
"// shave off first char if not valid",
"boolean",
"ready",
"=",
"false",
";",
"while",
"(",
"!",
"ready",
")",
"{",
"if",
"... | Removes all non JavaIdentifier chars from the start of the string.
@throws JSONException if the resulting string has zero length. | [
"Removes",
"all",
"non",
"JavaIdentifier",
"chars",
"from",
"the",
"start",
"of",
"the",
"string",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JavaIdentifierTransformer.java#L57-L72 |
102,945 | aalmiray/Json-lib | src/main/java/net/sf/json/xml/XMLSerializer.java | XMLSerializer.read | public JSON read( String xml ) {
JSON json = null;
try{
Document doc = new Builder().build( new StringReader( xml ) );
Element root = doc.getRootElement();
if( isNullObject( root ) ){
return JSONNull.getInstance();
}
String defaultType = getType( root... | java | public JSON read( String xml ) {
JSON json = null;
try{
Document doc = new Builder().build( new StringReader( xml ) );
Element root = doc.getRootElement();
if( isNullObject( root ) ){
return JSONNull.getInstance();
}
String defaultType = getType( root... | [
"public",
"JSON",
"read",
"(",
"String",
"xml",
")",
"{",
"JSON",
"json",
"=",
"null",
";",
"try",
"{",
"Document",
"doc",
"=",
"new",
"Builder",
"(",
")",
".",
"build",
"(",
"new",
"StringReader",
"(",
"xml",
")",
")",
";",
"Element",
"root",
"=",... | Creates a JSON value from a XML string.
@param xml A well-formed xml document in a String
@return a JSONNull, JSONObject or JSONArray
@throws JSONException if the conversion from XML to JSON can't be made for
I/O or format reasons. | [
"Creates",
"a",
"JSON",
"value",
"from",
"a",
"XML",
"string",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/xml/XMLSerializer.java#L356-L384 |
102,946 | aalmiray/Json-lib | src/main/java/net/sf/json/xml/XMLSerializer.java | XMLSerializer.readFromStream | public JSON readFromStream( InputStream stream ) {
try{
StringBuffer xml = new StringBuffer();
BufferedReader in = new BufferedReader( new InputStreamReader( stream ) );
String line = null;
while( (line = in.readLine()) != null ){
xml.append( line );
}
... | java | public JSON readFromStream( InputStream stream ) {
try{
StringBuffer xml = new StringBuffer();
BufferedReader in = new BufferedReader( new InputStreamReader( stream ) );
String line = null;
while( (line = in.readLine()) != null ){
xml.append( line );
}
... | [
"public",
"JSON",
"readFromStream",
"(",
"InputStream",
"stream",
")",
"{",
"try",
"{",
"StringBuffer",
"xml",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"BufferedReader",
"in",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"stream",
")",... | Creates a JSON value from an input stream.
@param stream
@return a JSONNull, JSONObject or JSONArray
@throws JSONException if the conversion from XML to JSON can't be made for
I/O or format reasons. | [
"Creates",
"a",
"JSON",
"value",
"from",
"an",
"input",
"stream",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/xml/XMLSerializer.java#L433-L445 |
102,947 | aalmiray/Json-lib | src/main/java/net/sf/json/xml/XMLSerializer.java | XMLSerializer.canAutoExpand | private boolean canAutoExpand( JSONArray array ) {
for( int i = 0; i < array.size(); i++ ){
if( !(array.get( i ) instanceof JSONObject) ){
return false;
}
}
return true;
} | java | private boolean canAutoExpand( JSONArray array ) {
for( int i = 0; i < array.size(); i++ ){
if( !(array.get( i ) instanceof JSONObject) ){
return false;
}
}
return true;
} | [
"private",
"boolean",
"canAutoExpand",
"(",
"JSONArray",
"array",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"(",
"array",
".",
"get",
"(",
"i",
")",
"i... | Only perform auto expansion if all children are objects.
@param array The array to check
@return True if all children are objects, false otherwise. | [
"Only",
"perform",
"auto",
"expansion",
"if",
"all",
"children",
"are",
"objects",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/xml/XMLSerializer.java#L1125-L1132 |
102,948 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.getFunctionBody | public static String getFunctionBody( String function ) {
return RegexpUtils.getMatcher( FUNCTION_BODY_PATTERN, true ).getGroupIfMatches( function, 1 );
} | java | public static String getFunctionBody( String function ) {
return RegexpUtils.getMatcher( FUNCTION_BODY_PATTERN, true ).getGroupIfMatches( function, 1 );
} | [
"public",
"static",
"String",
"getFunctionBody",
"(",
"String",
"function",
")",
"{",
"return",
"RegexpUtils",
".",
"getMatcher",
"(",
"FUNCTION_BODY_PATTERN",
",",
"true",
")",
".",
"getGroupIfMatches",
"(",
"function",
",",
"1",
")",
";",
"}"
] | Returns the body of a function literal. | [
"Returns",
"the",
"body",
"of",
"a",
"function",
"literal",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L124-L126 |
102,949 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.getFunctionParams | public static String getFunctionParams( String function ) {
return RegexpUtils.getMatcher( FUNCTION_PARAMS_PATTERN, true ).getGroupIfMatches( function, 1 );
} | java | public static String getFunctionParams( String function ) {
return RegexpUtils.getMatcher( FUNCTION_PARAMS_PATTERN, true ).getGroupIfMatches( function, 1 );
} | [
"public",
"static",
"String",
"getFunctionParams",
"(",
"String",
"function",
")",
"{",
"return",
"RegexpUtils",
".",
"getMatcher",
"(",
"FUNCTION_PARAMS_PATTERN",
",",
"true",
")",
".",
"getGroupIfMatches",
"(",
"function",
",",
"1",
")",
";",
"}"
] | Returns the params of a function literal. | [
"Returns",
"the",
"params",
"of",
"a",
"function",
"literal",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L131-L133 |
102,950 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.getInnerComponentType | public static Class getInnerComponentType( Class type ) {
if( !type.isArray() ){
return type;
}
return getInnerComponentType( type.getComponentType() );
} | java | public static Class getInnerComponentType( Class type ) {
if( !type.isArray() ){
return type;
}
return getInnerComponentType( type.getComponentType() );
} | [
"public",
"static",
"Class",
"getInnerComponentType",
"(",
"Class",
"type",
")",
"{",
"if",
"(",
"!",
"type",
".",
"isArray",
"(",
")",
")",
"{",
"return",
"type",
";",
"}",
"return",
"getInnerComponentType",
"(",
"type",
".",
"getComponentType",
"(",
")",... | Returns the inner-most component type of an Array. | [
"Returns",
"the",
"inner",
"-",
"most",
"component",
"type",
"of",
"an",
"Array",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L138-L143 |
102,951 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.getProperties | public static Map getProperties( JSONObject jsonObject ) {
Map properties = new HashMap();
for( Iterator keys = jsonObject.keys(); keys.hasNext(); ){
String key = (String) keys.next();
/*
* String parsedKey = key; if( !JSONUtils.isJavaIdentifier( parsedKey ) ){
* parsed... | java | public static Map getProperties( JSONObject jsonObject ) {
Map properties = new HashMap();
for( Iterator keys = jsonObject.keys(); keys.hasNext(); ){
String key = (String) keys.next();
/*
* String parsedKey = key; if( !JSONUtils.isJavaIdentifier( parsedKey ) ){
* parsed... | [
"public",
"static",
"Map",
"getProperties",
"(",
"JSONObject",
"jsonObject",
")",
"{",
"Map",
"properties",
"=",
"new",
"HashMap",
"(",
")",
";",
"for",
"(",
"Iterator",
"keys",
"=",
"jsonObject",
".",
"keys",
"(",
")",
";",
"keys",
".",
"hasNext",
"(",
... | Creates a Map with all the properties of the JSONObject. | [
"Creates",
"a",
"Map",
"with",
"all",
"the",
"properties",
"of",
"the",
"JSONObject",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L155-L166 |
102,952 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isArray | public static boolean isArray( Class clazz ) {
return clazz != null
&& (clazz.isArray() || Collection.class.isAssignableFrom( clazz ) || (JSONArray.class.isAssignableFrom( clazz )));
} | java | public static boolean isArray( Class clazz ) {
return clazz != null
&& (clazz.isArray() || Collection.class.isAssignableFrom( clazz ) || (JSONArray.class.isAssignableFrom( clazz )));
} | [
"public",
"static",
"boolean",
"isArray",
"(",
"Class",
"clazz",
")",
"{",
"return",
"clazz",
"!=",
"null",
"&&",
"(",
"clazz",
".",
"isArray",
"(",
")",
"||",
"Collection",
".",
"class",
".",
"isAssignableFrom",
"(",
"clazz",
")",
"||",
"(",
"JSONArray"... | Tests if a Class represents an array or Collection. | [
"Tests",
"if",
"a",
"Class",
"represents",
"an",
"array",
"or",
"Collection",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L229-L232 |
102,953 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isArray | public static boolean isArray( Object obj ) {
if( (obj != null && obj.getClass()
.isArray()) || (obj instanceof Collection) || (obj instanceof JSONArray) ){
return true;
}
return false;
} | java | public static boolean isArray( Object obj ) {
if( (obj != null && obj.getClass()
.isArray()) || (obj instanceof Collection) || (obj instanceof JSONArray) ){
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isArray",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"(",
"obj",
"!=",
"null",
"&&",
"obj",
".",
"getClass",
"(",
")",
".",
"isArray",
"(",
")",
")",
"||",
"(",
"obj",
"instanceof",
"Collection",
")",
"||",
"(",
"obj... | Tests if obj is an array or Collection. | [
"Tests",
"if",
"obj",
"is",
"an",
"array",
"or",
"Collection",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L237-L243 |
102,954 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isBoolean | public static boolean isBoolean( Class clazz ) {
return clazz != null
&& (Boolean.TYPE.isAssignableFrom( clazz ) || Boolean.class.isAssignableFrom( clazz ));
} | java | public static boolean isBoolean( Class clazz ) {
return clazz != null
&& (Boolean.TYPE.isAssignableFrom( clazz ) || Boolean.class.isAssignableFrom( clazz ));
} | [
"public",
"static",
"boolean",
"isBoolean",
"(",
"Class",
"clazz",
")",
"{",
"return",
"clazz",
"!=",
"null",
"&&",
"(",
"Boolean",
".",
"TYPE",
".",
"isAssignableFrom",
"(",
"clazz",
")",
"||",
"Boolean",
".",
"class",
".",
"isAssignableFrom",
"(",
"clazz... | Tests if Class represents a Boolean or primitive boolean | [
"Tests",
"if",
"Class",
"represents",
"a",
"Boolean",
"or",
"primitive",
"boolean"
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L248-L251 |
102,955 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isBoolean | public static boolean isBoolean( Object obj ) {
if( (obj instanceof Boolean) || (obj != null && obj.getClass() == Boolean.TYPE) ){
return true;
}
return false;
} | java | public static boolean isBoolean( Object obj ) {
if( (obj instanceof Boolean) || (obj != null && obj.getClass() == Boolean.TYPE) ){
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isBoolean",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"(",
"obj",
"instanceof",
"Boolean",
")",
"||",
"(",
"obj",
"!=",
"null",
"&&",
"obj",
".",
"getClass",
"(",
")",
"==",
"Boolean",
".",
"TYPE",
")",
")",
"{",
"r... | Tests if obj is a Boolean or primitive boolean | [
"Tests",
"if",
"obj",
"is",
"a",
"Boolean",
"or",
"primitive",
"boolean"
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L256-L261 |
102,956 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isJavaIdentifier | public static boolean isJavaIdentifier( String str ) {
if( str.length() == 0 || !Character.isJavaIdentifierStart( str.charAt( 0 ) ) ){
return false;
}
for( int i = 1; i < str.length(); i++ ){
if( !Character.isJavaIdentifierPart( str.charAt( i ) ) ){
return false;
... | java | public static boolean isJavaIdentifier( String str ) {
if( str.length() == 0 || !Character.isJavaIdentifierStart( str.charAt( 0 ) ) ){
return false;
}
for( int i = 1; i < str.length(); i++ ){
if( !Character.isJavaIdentifierPart( str.charAt( i ) ) ){
return false;
... | [
"public",
"static",
"boolean",
"isJavaIdentifier",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
".",
"length",
"(",
")",
"==",
"0",
"||",
"!",
"Character",
".",
"isJavaIdentifierStart",
"(",
"str",
".",
"charAt",
"(",
"0",
")",
")",
")",
"{",
"r... | Returns trus if str represents a valid Java identifier. | [
"Returns",
"trus",
"if",
"str",
"represents",
"a",
"valid",
"Java",
"identifier",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L302-L312 |
102,957 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isNull | public static boolean isNull( Object obj ) {
if( obj instanceof JSONObject ){
return ((JSONObject) obj).isNullObject();
}
return JSONNull.getInstance()
.equals( obj );
} | java | public static boolean isNull( Object obj ) {
if( obj instanceof JSONObject ){
return ((JSONObject) obj).isNullObject();
}
return JSONNull.getInstance()
.equals( obj );
} | [
"public",
"static",
"boolean",
"isNull",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"JSONObject",
")",
"{",
"return",
"(",
"(",
"JSONObject",
")",
"obj",
")",
".",
"isNullObject",
"(",
")",
";",
"}",
"return",
"JSONNull",
".",
"get... | Tests if the obj is a javaScript null. | [
"Tests",
"if",
"the",
"obj",
"is",
"a",
"javaScript",
"null",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L317-L323 |
102,958 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isObject | public static boolean isObject( Object obj ) {
return !isNumber( obj ) && !isString( obj ) && !isBoolean( obj ) && !isArray( obj )
&& !isFunction( obj ) || isNull( obj );
} | java | public static boolean isObject( Object obj ) {
return !isNumber( obj ) && !isString( obj ) && !isBoolean( obj ) && !isArray( obj )
&& !isFunction( obj ) || isNull( obj );
} | [
"public",
"static",
"boolean",
"isObject",
"(",
"Object",
"obj",
")",
"{",
"return",
"!",
"isNumber",
"(",
"obj",
")",
"&&",
"!",
"isString",
"(",
"obj",
")",
"&&",
"!",
"isBoolean",
"(",
"obj",
")",
"&&",
"!",
"isArray",
"(",
"obj",
")",
"&&",
"!"... | Tests if obj is not a boolean, number, string or array. | [
"Tests",
"if",
"obj",
"is",
"not",
"a",
"boolean",
"number",
"string",
"or",
"array",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L354-L357 |
102,959 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isString | public static boolean isString( Class clazz ) {
return clazz != null
&& (String.class.isAssignableFrom( clazz ) || (Character.TYPE.isAssignableFrom( clazz ) || Character.class.isAssignableFrom( clazz )));
} | java | public static boolean isString( Class clazz ) {
return clazz != null
&& (String.class.isAssignableFrom( clazz ) || (Character.TYPE.isAssignableFrom( clazz ) || Character.class.isAssignableFrom( clazz )));
} | [
"public",
"static",
"boolean",
"isString",
"(",
"Class",
"clazz",
")",
"{",
"return",
"clazz",
"!=",
"null",
"&&",
"(",
"String",
".",
"class",
".",
"isAssignableFrom",
"(",
"clazz",
")",
"||",
"(",
"Character",
".",
"TYPE",
".",
"isAssignableFrom",
"(",
... | Tests if Class represents a String or a char | [
"Tests",
"if",
"Class",
"represents",
"a",
"String",
"or",
"a",
"char"
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L362-L365 |
102,960 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isString | public static boolean isString( Object obj ) {
if( (obj instanceof String)
|| (obj instanceof Character)
|| (obj != null && (obj.getClass() == Character.TYPE || String.class.isAssignableFrom( obj.getClass() ))) ){
return true;
}
return false;
} | java | public static boolean isString( Object obj ) {
if( (obj instanceof String)
|| (obj instanceof Character)
|| (obj != null && (obj.getClass() == Character.TYPE || String.class.isAssignableFrom( obj.getClass() ))) ){
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isString",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"(",
"obj",
"instanceof",
"String",
")",
"||",
"(",
"obj",
"instanceof",
"Character",
")",
"||",
"(",
"obj",
"!=",
"null",
"&&",
"(",
"obj",
".",
"getClass",
"(",
"... | Tests if obj is a String or a char | [
"Tests",
"if",
"obj",
"is",
"a",
"String",
"or",
"a",
"char"
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L370-L377 |
102,961 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.newDynaBean | public static DynaBean newDynaBean( JSONObject jsonObject, JsonConfig jsonConfig ) {
Map props = getProperties( jsonObject );
for( Iterator entries = props.entrySet()
.iterator(); entries.hasNext(); ){
Map.Entry entry = (Map.Entry) entries.next();
String key = (String) entry.ge... | java | public static DynaBean newDynaBean( JSONObject jsonObject, JsonConfig jsonConfig ) {
Map props = getProperties( jsonObject );
for( Iterator entries = props.entrySet()
.iterator(); entries.hasNext(); ){
Map.Entry entry = (Map.Entry) entries.next();
String key = (String) entry.ge... | [
"public",
"static",
"DynaBean",
"newDynaBean",
"(",
"JSONObject",
"jsonObject",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"Map",
"props",
"=",
"getProperties",
"(",
"jsonObject",
")",
";",
"for",
"(",
"Iterator",
"entries",
"=",
"props",
".",
"entrySet",
"(",... | Creates a new MorphDynaBean from a JSONObject. The MorphDynaBean will have
all the properties of the original JSONObject with the most accurate type.
Values of properties are not copied. | [
"Creates",
"a",
"new",
"MorphDynaBean",
"from",
"a",
"JSONObject",
".",
"The",
"MorphDynaBean",
"will",
"have",
"all",
"the",
"properties",
"of",
"the",
"original",
"JSONObject",
"with",
"the",
"most",
"accurate",
"type",
".",
"Values",
"of",
"properties",
"ar... | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L408-L430 |
102,962 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.quoteCanonical | public static String quoteCanonical(String s) {
if (s == null || s.length() == 0) {
return "\"\"";
}
int len = s.length();
StringBuilder sb = new StringBuilder(len + 4);
sb.append('"');
for (int i = 0; i < len; i += 1) {
char c = s.charAt(i);
... | java | public static String quoteCanonical(String s) {
if (s == null || s.length() == 0) {
return "\"\"";
}
int len = s.length();
StringBuilder sb = new StringBuilder(len + 4);
sb.append('"');
for (int i = 0; i < len; i += 1) {
char c = s.charAt(i);
... | [
"public",
"static",
"String",
"quoteCanonical",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"\"\\\"\\\"\"",
";",
"}",
"int",
"len",
"=",
"s",
".",
"length",
"(",
"... | Minimal escape form. | [
"Minimal",
"escape",
"form",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L554-L583 |
102,963 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.stripQuotes | public static String stripQuotes( String input ) {
if( input.length() < 2 ){
return input;
}else if( input.startsWith( SINGLE_QUOTE ) && input.endsWith( SINGLE_QUOTE ) ){
return input.substring( 1, input.length() - 1 );
}else if( input.startsWith( DOUBLE_QUOTE ) && input.endsWith( DO... | java | public static String stripQuotes( String input ) {
if( input.length() < 2 ){
return input;
}else if( input.startsWith( SINGLE_QUOTE ) && input.endsWith( SINGLE_QUOTE ) ){
return input.substring( 1, input.length() - 1 );
}else if( input.startsWith( DOUBLE_QUOTE ) && input.endsWith( DO... | [
"public",
"static",
"String",
"stripQuotes",
"(",
"String",
"input",
")",
"{",
"if",
"(",
"input",
".",
"length",
"(",
")",
"<",
"2",
")",
"{",
"return",
"input",
";",
"}",
"else",
"if",
"(",
"input",
".",
"startsWith",
"(",
"SINGLE_QUOTE",
")",
"&&"... | Strips any single-quotes or double-quotes from both sides of the string. | [
"Strips",
"any",
"single",
"-",
"quotes",
"or",
"double",
"-",
"quotes",
"from",
"both",
"sides",
"of",
"the",
"string",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L588-L598 |
102,964 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.hasQuotes | public static boolean hasQuotes( String input ) {
if( input == null || input.length() < 2 ){
return false;
}
return input.startsWith( SINGLE_QUOTE ) && input.endsWith( SINGLE_QUOTE ) ||
input.startsWith( DOUBLE_QUOTE ) && input.endsWith( DOUBLE_QUOTE );
} | java | public static boolean hasQuotes( String input ) {
if( input == null || input.length() < 2 ){
return false;
}
return input.startsWith( SINGLE_QUOTE ) && input.endsWith( SINGLE_QUOTE ) ||
input.startsWith( DOUBLE_QUOTE ) && input.endsWith( DOUBLE_QUOTE );
} | [
"public",
"static",
"boolean",
"hasQuotes",
"(",
"String",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
"||",
"input",
".",
"length",
"(",
")",
"<",
"2",
")",
"{",
"return",
"false",
";",
"}",
"return",
"input",
".",
"startsWith",
"(",
"SINGL... | Returns true if the input has single-quotes or double-quotes at both sides. | [
"Returns",
"true",
"if",
"the",
"input",
"has",
"single",
"-",
"quotes",
"or",
"double",
"-",
"quotes",
"at",
"both",
"sides",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L603-L609 |
102,965 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isDouble | private static boolean isDouble( Number n ) {
if( n instanceof Double ){
return true;
}
try{
double d = Double.parseDouble( String.valueOf( n ) );
return !Double.isInfinite( d );
}catch( NumberFormatException e ){
return false;
}
} | java | private static boolean isDouble( Number n ) {
if( n instanceof Double ){
return true;
}
try{
double d = Double.parseDouble( String.valueOf( n ) );
return !Double.isInfinite( d );
}catch( NumberFormatException e ){
return false;
}
} | [
"private",
"static",
"boolean",
"isDouble",
"(",
"Number",
"n",
")",
"{",
"if",
"(",
"n",
"instanceof",
"Double",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"double",
"d",
"=",
"Double",
".",
"parseDouble",
"(",
"String",
".",
"valueOf",
"(",
... | Finds out if n represents a Double.
@return true if n is instanceOf Double or the literal value can be
evaluated as a Double. | [
"Finds",
"out",
"if",
"n",
"represents",
"a",
"Double",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L801-L811 |
102,966 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isFloat | private static boolean isFloat( Number n ) {
if( n instanceof Float ){
return true;
}
try{
float f = Float.parseFloat( String.valueOf( n ) );
return !Float.isInfinite( f );
}catch( NumberFormatException e ){
return false;
}
} | java | private static boolean isFloat( Number n ) {
if( n instanceof Float ){
return true;
}
try{
float f = Float.parseFloat( String.valueOf( n ) );
return !Float.isInfinite( f );
}catch( NumberFormatException e ){
return false;
}
} | [
"private",
"static",
"boolean",
"isFloat",
"(",
"Number",
"n",
")",
"{",
"if",
"(",
"n",
"instanceof",
"Float",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"float",
"f",
"=",
"Float",
".",
"parseFloat",
"(",
"String",
".",
"valueOf",
"(",
"n",
... | Finds out if n represents a Float.
@return true if n is instanceOf Float or the literal value can be
evaluated as a Float. | [
"Finds",
"out",
"if",
"n",
"represents",
"a",
"Float",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L819-L829 |
102,967 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isInteger | private static boolean isInteger( Number n ) {
if( n instanceof Integer ){
return true;
}
try{
Integer.parseInt( String.valueOf( n ) );
return true;
}catch( NumberFormatException e ){
return false;
}
} | java | private static boolean isInteger( Number n ) {
if( n instanceof Integer ){
return true;
}
try{
Integer.parseInt( String.valueOf( n ) );
return true;
}catch( NumberFormatException e ){
return false;
}
} | [
"private",
"static",
"boolean",
"isInteger",
"(",
"Number",
"n",
")",
"{",
"if",
"(",
"n",
"instanceof",
"Integer",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"Integer",
".",
"parseInt",
"(",
"String",
".",
"valueOf",
"(",
"n",
")",
")",
";",
... | Finds out if n represents an Integer.
@return true if n is instanceOf Integer or the literal value can be
evaluated as an Integer. | [
"Finds",
"out",
"if",
"n",
"represents",
"an",
"Integer",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L837-L847 |
102,968 | aalmiray/Json-lib | src/main/java/net/sf/json/util/JSONUtils.java | JSONUtils.isLong | private static boolean isLong( Number n ) {
if( n instanceof Long ){
return true;
}
try{
Long.parseLong( String.valueOf( n ) );
return true;
}catch( NumberFormatException e ){
return false;
}
} | java | private static boolean isLong( Number n ) {
if( n instanceof Long ){
return true;
}
try{
Long.parseLong( String.valueOf( n ) );
return true;
}catch( NumberFormatException e ){
return false;
}
} | [
"private",
"static",
"boolean",
"isLong",
"(",
"Number",
"n",
")",
"{",
"if",
"(",
"n",
"instanceof",
"Long",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"Long",
".",
"parseLong",
"(",
"String",
".",
"valueOf",
"(",
"n",
")",
")",
";",
"retur... | Finds out if n represents a Long.
@return true if n is instanceOf Long or the literal value can be evaluated
as a Long. | [
"Finds",
"out",
"if",
"n",
"represents",
"a",
"Long",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/util/JSONUtils.java#L855-L865 |
102,969 | aalmiray/Json-lib | src/main/java/net/sf/json/JSONFunction.java | JSONFunction.parse | public static JSONFunction parse( String str ) {
if( !JSONUtils.isFunction( str ) ) {
throw new JSONException( "String is not a function. " + str );
} else {
String params = JSONUtils.getFunctionParams( str );
String text = JSONUtils.getFunctionBody( str );
return new JSO... | java | public static JSONFunction parse( String str ) {
if( !JSONUtils.isFunction( str ) ) {
throw new JSONException( "String is not a function. " + str );
} else {
String params = JSONUtils.getFunctionParams( str );
String text = JSONUtils.getFunctionBody( str );
return new JSO... | [
"public",
"static",
"JSONFunction",
"parse",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"!",
"JSONUtils",
".",
"isFunction",
"(",
"str",
")",
")",
"{",
"throw",
"new",
"JSONException",
"(",
"\"String is not a function. \"",
"+",
"str",
")",
";",
"}",
"else... | Constructs a JSONFunction from a text representation | [
"Constructs",
"a",
"JSONFunction",
"from",
"a",
"text",
"representation"
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONFunction.java#L40-L48 |
102,970 | aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.getDimensions | public static int[] getDimensions( JSONArray jsonArray ) {
// short circuit for empty arrays
if( jsonArray == null || jsonArray.isEmpty() ){
return new int[] { 0 };
}
List dims = new ArrayList();
processArrayDimensions( jsonArray, dims, 0 );
int[] dimensions = new int[dims.... | java | public static int[] getDimensions( JSONArray jsonArray ) {
// short circuit for empty arrays
if( jsonArray == null || jsonArray.isEmpty() ){
return new int[] { 0 };
}
List dims = new ArrayList();
processArrayDimensions( jsonArray, dims, 0 );
int[] dimensions = new int[dims.... | [
"public",
"static",
"int",
"[",
"]",
"getDimensions",
"(",
"JSONArray",
"jsonArray",
")",
"{",
"// short circuit for empty arrays",
"if",
"(",
"jsonArray",
"==",
"null",
"||",
"jsonArray",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"new",
"int",
"[",
"]",... | Returns the number of dimensions suited for a java array. | [
"Returns",
"the",
"number",
"of",
"dimensions",
"suited",
"for",
"a",
"java",
"array",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L172-L186 |
102,971 | aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.toArray | public static Object toArray( JSONArray jsonArray, Class objectClass ) {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setRootClass( objectClass );
return toArray( jsonArray, jsonConfig );
} | java | public static Object toArray( JSONArray jsonArray, Class objectClass ) {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setRootClass( objectClass );
return toArray( jsonArray, jsonConfig );
} | [
"public",
"static",
"Object",
"toArray",
"(",
"JSONArray",
"jsonArray",
",",
"Class",
"objectClass",
")",
"{",
"JsonConfig",
"jsonConfig",
"=",
"new",
"JsonConfig",
"(",
")",
";",
"jsonConfig",
".",
"setRootClass",
"(",
"objectClass",
")",
";",
"return",
"toAr... | Creates a java array from a JSONArray. | [
"Creates",
"a",
"java",
"array",
"from",
"a",
"JSONArray",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L198-L202 |
102,972 | aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.toCollection | public static Collection toCollection( JSONArray jsonArray, Class objectClass ) {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setRootClass( objectClass );
return toCollection( jsonArray, jsonConfig );
} | java | public static Collection toCollection( JSONArray jsonArray, Class objectClass ) {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setRootClass( objectClass );
return toCollection( jsonArray, jsonConfig );
} | [
"public",
"static",
"Collection",
"toCollection",
"(",
"JSONArray",
"jsonArray",
",",
"Class",
"objectClass",
")",
"{",
"JsonConfig",
"jsonConfig",
"=",
"new",
"JsonConfig",
"(",
")",
";",
"jsonConfig",
".",
"setRootClass",
"(",
"objectClass",
")",
";",
"return"... | Creates a Collection from a JSONArray. | [
"Creates",
"a",
"Collection",
"from",
"a",
"JSONArray",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L335-L339 |
102,973 | aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.toList | public static List toList( JSONArray jsonArray, Class objectClass ) {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setRootClass( objectClass );
return toList( jsonArray, jsonConfig );
} | java | public static List toList( JSONArray jsonArray, Class objectClass ) {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setRootClass( objectClass );
return toList( jsonArray, jsonConfig );
} | [
"public",
"static",
"List",
"toList",
"(",
"JSONArray",
"jsonArray",
",",
"Class",
"objectClass",
")",
"{",
"JsonConfig",
"jsonConfig",
"=",
"new",
"JsonConfig",
"(",
")",
";",
"jsonConfig",
".",
"setRootClass",
"(",
"objectClass",
")",
";",
"return",
"toList"... | Creates a List from a JSONArray.
@deprecated replaced by toCollection
@see #toCollection(JSONArray,Class) | [
"Creates",
"a",
"List",
"from",
"a",
"JSONArray",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L421-L425 |
102,974 | aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.element | public JSONArray element( Collection value, JsonConfig jsonConfig ) {
if( value instanceof JSONArray ){
elements.add( value );
return this;
}else{
return element( _fromCollection( value, jsonConfig ) );
}
} | java | public JSONArray element( Collection value, JsonConfig jsonConfig ) {
if( value instanceof JSONArray ){
elements.add( value );
return this;
}else{
return element( _fromCollection( value, jsonConfig ) );
}
} | [
"public",
"JSONArray",
"element",
"(",
"Collection",
"value",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"value",
"instanceof",
"JSONArray",
")",
"{",
"elements",
".",
"add",
"(",
"value",
")",
";",
"return",
"this",
";",
"}",
"else",
"{",
"re... | Append a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.
@param value A Collection value.
@return this. | [
"Append",
"a",
"value",
"in",
"the",
"JSONArray",
"where",
"the",
"value",
"will",
"be",
"a",
"JSONArray",
"which",
"is",
"produced",
"from",
"a",
"Collection",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L1208-L1215 |
102,975 | aalmiray/Json-lib | src/main/jdk15/net/sf/json/JSONArray.java | JSONArray._fromArray | private static JSONArray _fromArray( Enum e, JsonConfig jsonConfig ) {
if( !addInstance( e ) ){
try{
return jsonConfig.getCycleDetectionStrategy()
.handleRepeatedReferenceAsArray( e );
}catch( JSONException jsone ){
removeInstance( e );
fireE... | java | private static JSONArray _fromArray( Enum e, JsonConfig jsonConfig ) {
if( !addInstance( e ) ){
try{
return jsonConfig.getCycleDetectionStrategy()
.handleRepeatedReferenceAsArray( e );
}catch( JSONException jsone ){
removeInstance( e );
fireE... | [
"private",
"static",
"JSONArray",
"_fromArray",
"(",
"Enum",
"e",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"!",
"addInstance",
"(",
"e",
")",
")",
"{",
"try",
"{",
"return",
"jsonConfig",
".",
"getCycleDetectionStrategy",
"(",
")",
".",
"handl... | Construct a JSONArray from an Enum value.
@param e A enum value.
@throws JSONException If there is a syntax error. | [
"Construct",
"a",
"JSONArray",
"from",
"an",
"Enum",
"value",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/jdk15/net/sf/json/JSONArray.java#L816-L847 |
102,976 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.fireArrayEndEvent | protected static void fireArrayEndEvent( JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listeners.next();
... | java | protected static void fireArrayEndEvent( JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listeners.next();
... | [
"protected",
"static",
"void",
"fireArrayEndEvent",
"(",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"jsonConfig",
".",
"isEventTriggeringEnabled",
"(",
")",
")",
"{",
"for",
"(",
"Iterator",
"listeners",
"=",
"jsonConfig",
".",
"getJsonEventListeners",
"(",
... | Fires an end of array event. | [
"Fires",
"an",
"end",
"of",
"array",
"event",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L73-L85 |
102,977 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.fireArrayStartEvent | protected static void fireArrayStartEvent( JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listeners.next();... | java | protected static void fireArrayStartEvent( JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listeners.next();... | [
"protected",
"static",
"void",
"fireArrayStartEvent",
"(",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"jsonConfig",
".",
"isEventTriggeringEnabled",
"(",
")",
")",
"{",
"for",
"(",
"Iterator",
"listeners",
"=",
"jsonConfig",
".",
"getJsonEventListeners",
"("... | Fires a start of array event. | [
"Fires",
"a",
"start",
"of",
"array",
"event",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L90-L102 |
102,978 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.fireElementAddedEvent | protected static void fireElementAddedEvent( int index, Object element, JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEve... | java | protected static void fireElementAddedEvent( int index, Object element, JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEve... | [
"protected",
"static",
"void",
"fireElementAddedEvent",
"(",
"int",
"index",
",",
"Object",
"element",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"jsonConfig",
".",
"isEventTriggeringEnabled",
"(",
")",
")",
"{",
"for",
"(",
"Iterator",
"listeners",
... | Fires an element added event.
@param index the index where the element was added
@param element the added element | [
"Fires",
"an",
"element",
"added",
"event",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L110-L122 |
102,979 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.fireErrorEvent | protected static void fireErrorEvent( JSONException jsone, JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) l... | java | protected static void fireErrorEvent( JSONException jsone, JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) l... | [
"protected",
"static",
"void",
"fireErrorEvent",
"(",
"JSONException",
"jsone",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"jsonConfig",
".",
"isEventTriggeringEnabled",
"(",
")",
")",
"{",
"for",
"(",
"Iterator",
"listeners",
"=",
"jsonConfig",
".",
... | Fires an error event.
@param jsone the thrown exception | [
"Fires",
"an",
"error",
"event",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L129-L141 |
102,980 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.fireObjectEndEvent | protected static void fireObjectEndEvent( JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listeners.next();
... | java | protected static void fireObjectEndEvent( JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listeners.next();
... | [
"protected",
"static",
"void",
"fireObjectEndEvent",
"(",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"jsonConfig",
".",
"isEventTriggeringEnabled",
"(",
")",
")",
"{",
"for",
"(",
"Iterator",
"listeners",
"=",
"jsonConfig",
".",
"getJsonEventListeners",
"(",... | Fires an end of object event. | [
"Fires",
"an",
"end",
"of",
"object",
"event",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L146-L158 |
102,981 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.fireObjectStartEvent | protected static void fireObjectStartEvent( JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listeners.next()... | java | protected static void fireObjectStartEvent( JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listeners.next()... | [
"protected",
"static",
"void",
"fireObjectStartEvent",
"(",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"jsonConfig",
".",
"isEventTriggeringEnabled",
"(",
")",
")",
"{",
"for",
"(",
"Iterator",
"listeners",
"=",
"jsonConfig",
".",
"getJsonEventListeners",
"(... | Fires a start of object event. | [
"Fires",
"a",
"start",
"of",
"object",
"event",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L163-L175 |
102,982 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.firePropertySetEvent | protected static void firePropertySetEvent( String key, Object value, boolean accumulated,
JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEvent... | java | protected static void firePropertySetEvent( String key, Object value, boolean accumulated,
JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEvent... | [
"protected",
"static",
"void",
"firePropertySetEvent",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"boolean",
"accumulated",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"jsonConfig",
".",
"isEventTriggeringEnabled",
"(",
")",
")",
"{",
"for",
... | Fires a property set event.
@param key the name of the property
@param value the value of the property
@param accumulated if the value has been accumulated over 'key' | [
"Fires",
"a",
"property",
"set",
"event",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L184-L197 |
102,983 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.fireWarnEvent | protected static void fireWarnEvent( String warning, JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listene... | java | protected static void fireWarnEvent( String warning, JsonConfig jsonConfig ) {
if( jsonConfig.isEventTriggeringEnabled() ){
for( Iterator listeners = jsonConfig.getJsonEventListeners()
.iterator(); listeners.hasNext(); ){
JsonEventListener listener = (JsonEventListener) listene... | [
"protected",
"static",
"void",
"fireWarnEvent",
"(",
"String",
"warning",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"jsonConfig",
".",
"isEventTriggeringEnabled",
"(",
")",
")",
"{",
"for",
"(",
"Iterator",
"listeners",
"=",
"jsonConfig",
".",
"get... | Fires a warning event.
@param warning the warning message | [
"Fires",
"a",
"warning",
"event",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L204-L216 |
102,984 | aalmiray/Json-lib | src/main/java/net/sf/json/AbstractJSON.java | AbstractJSON.removeInstance | protected static void removeInstance( Object instance ) {
Set set = getCycleSet();
set.remove( instance );
if(set.size() == 0) {
cycleSet.remove();
}
} | java | protected static void removeInstance( Object instance ) {
Set set = getCycleSet();
set.remove( instance );
if(set.size() == 0) {
cycleSet.remove();
}
} | [
"protected",
"static",
"void",
"removeInstance",
"(",
"Object",
"instance",
")",
"{",
"Set",
"set",
"=",
"getCycleSet",
"(",
")",
";",
"set",
".",
"remove",
"(",
"instance",
")",
";",
"if",
"(",
"set",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"c... | Removes a reference for cycle detection check. | [
"Removes",
"a",
"reference",
"for",
"cycle",
"detection",
"check",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/AbstractJSON.java#L221-L227 |
102,985 | aalmiray/Json-lib | src/main/java/net/sf/json/processors/JsonVerifier.java | JsonVerifier.isValidJsonValue | public static boolean isValidJsonValue( Object value ) {
if( JSONNull.getInstance()
.equals( value ) || value instanceof JSON || value instanceof Boolean
|| value instanceof Byte || value instanceof Short
|| value instanceof Integer || value instanceof Long || value instanceof ... | java | public static boolean isValidJsonValue( Object value ) {
if( JSONNull.getInstance()
.equals( value ) || value instanceof JSON || value instanceof Boolean
|| value instanceof Byte || value instanceof Short
|| value instanceof Integer || value instanceof Long || value instanceof ... | [
"public",
"static",
"boolean",
"isValidJsonValue",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"JSONNull",
".",
"getInstance",
"(",
")",
".",
"equals",
"(",
"value",
")",
"||",
"value",
"instanceof",
"JSON",
"||",
"value",
"instanceof",
"Boolean",
"||",
"... | Verifies if value is a valid JSON value.
@param value the value to verify | [
"Verifies",
"if",
"value",
"is",
"a",
"valid",
"JSON",
"value",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/processors/JsonVerifier.java#L39-L50 |
102,986 | aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.reset | public void reset() {
excludes = EMPTY_EXCLUDES;
ignoreDefaultExcludes = false;
ignoreTransientFields = false;
ignorePublicFields = true;
javascriptCompliant = false;
javaIdentifierTransformer = DEFAULT_JAVA_IDENTIFIER_TRANSFORMER;
cycleDetectionStrategy = DEFAULT_CYCLE_DETECTI... | java | public void reset() {
excludes = EMPTY_EXCLUDES;
ignoreDefaultExcludes = false;
ignoreTransientFields = false;
ignorePublicFields = true;
javascriptCompliant = false;
javaIdentifierTransformer = DEFAULT_JAVA_IDENTIFIER_TRANSFORMER;
cycleDetectionStrategy = DEFAULT_CYCLE_DETECTI... | [
"public",
"void",
"reset",
"(",
")",
"{",
"excludes",
"=",
"EMPTY_EXCLUDES",
";",
"ignoreDefaultExcludes",
"=",
"false",
";",
"ignoreTransientFields",
"=",
"false",
";",
"ignorePublicFields",
"=",
"true",
";",
"javascriptCompliant",
"=",
"false",
";",
"javaIdentif... | Resets all values to its default state. | [
"Resets",
"all",
"values",
"to",
"its",
"default",
"state",
"."
] | 9e2b3376ee8f511a48aa7ac05f75a7414e02280f | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L928-L967 |
102,987 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikTracker.java | PiwikTracker.sendRequest | public HttpResponse sendRequest(PiwikRequest request) throws IOException{
HttpClient client = getHttpClient();
uriBuilder.replaceQuery(request.getUrlEncodedQueryString());
HttpGet get = new HttpGet(uriBuilder.build());
try {
return client.execute(get);
} finally {
... | java | public HttpResponse sendRequest(PiwikRequest request) throws IOException{
HttpClient client = getHttpClient();
uriBuilder.replaceQuery(request.getUrlEncodedQueryString());
HttpGet get = new HttpGet(uriBuilder.build());
try {
return client.execute(get);
} finally {
... | [
"public",
"HttpResponse",
"sendRequest",
"(",
"PiwikRequest",
"request",
")",
"throws",
"IOException",
"{",
"HttpClient",
"client",
"=",
"getHttpClient",
"(",
")",
";",
"uriBuilder",
".",
"replaceQuery",
"(",
"request",
".",
"getUrlEncodedQueryString",
"(",
")",
"... | Send a request.
@param request request to send
@return the response from this request
@throws IOException thrown if there was a problem with this connection | [
"Send",
"a",
"request",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikTracker.java#L87-L97 |
102,988 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikTracker.java | PiwikTracker.sendBulkRequest | public HttpResponse sendBulkRequest(Iterable<PiwikRequest> requests, String authToken) throws IOException{
if (authToken != null && authToken.length() != PiwikRequest.AUTH_TOKEN_LENGTH){
throw new IllegalArgumentException(authToken+" is not "+PiwikRequest.AUTH_TOKEN_LENGTH+" characters long.");
... | java | public HttpResponse sendBulkRequest(Iterable<PiwikRequest> requests, String authToken) throws IOException{
if (authToken != null && authToken.length() != PiwikRequest.AUTH_TOKEN_LENGTH){
throw new IllegalArgumentException(authToken+" is not "+PiwikRequest.AUTH_TOKEN_LENGTH+" characters long.");
... | [
"public",
"HttpResponse",
"sendBulkRequest",
"(",
"Iterable",
"<",
"PiwikRequest",
">",
"requests",
",",
"String",
"authToken",
")",
"throws",
"IOException",
"{",
"if",
"(",
"authToken",
"!=",
"null",
"&&",
"authToken",
".",
"length",
"(",
")",
"!=",
"PiwikReq... | Send multiple requests in a single HTTP call. More efficient than sending
several individual requests. Specify the AuthToken if parameters that require
an auth token is used.
@param requests the requests to send
@param authToken specify if any of the parameters use require AuthToken
@return the response from these re... | [
"Send",
"multiple",
"requests",
"in",
"a",
"single",
"HTTP",
"call",
".",
"More",
"efficient",
"than",
"sending",
"several",
"individual",
"requests",
".",
"Specify",
"the",
"AuthToken",
"if",
"parameters",
"that",
"require",
"an",
"auth",
"token",
"is",
"used... | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikTracker.java#L119-L147 |
102,989 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikTracker.java | PiwikTracker.getHttpClient | protected HttpClient getHttpClient(){
HttpClientBuilder builder = HttpClientBuilder.create();
if(proxyHost != null && proxyPort != 0) {
HttpHost proxy = new HttpHost(proxyHost, proxyPort);
DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
... | java | protected HttpClient getHttpClient(){
HttpClientBuilder builder = HttpClientBuilder.create();
if(proxyHost != null && proxyPort != 0) {
HttpHost proxy = new HttpHost(proxyHost, proxyPort);
DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
... | [
"protected",
"HttpClient",
"getHttpClient",
"(",
")",
"{",
"HttpClientBuilder",
"builder",
"=",
"HttpClientBuilder",
".",
"create",
"(",
")",
";",
"if",
"(",
"proxyHost",
"!=",
"null",
"&&",
"proxyPort",
"!=",
"0",
")",
"{",
"HttpHost",
"proxy",
"=",
"new",
... | Get a HTTP client. With proxy if a proxy is provided in the constructor.
@return a HTTP client | [
"Get",
"a",
"HTTP",
"client",
".",
"With",
"proxy",
"if",
"a",
"proxy",
"is",
"provided",
"in",
"the",
"constructor",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikTracker.java#L153-L171 |
102,990 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/EcommerceItem.java | EcommerceItem.toJsonArray | JsonArray toJsonArray(){
JsonArrayBuilder ab = Json.createArrayBuilder();
ab.add(sku);
ab.add(name);
ab.add(category);
ab.add(price);
ab.add(quantity);
return ab.build();
} | java | JsonArray toJsonArray(){
JsonArrayBuilder ab = Json.createArrayBuilder();
ab.add(sku);
ab.add(name);
ab.add(category);
ab.add(price);
ab.add(quantity);
return ab.build();
} | [
"JsonArray",
"toJsonArray",
"(",
")",
"{",
"JsonArrayBuilder",
"ab",
"=",
"Json",
".",
"createArrayBuilder",
"(",
")",
";",
"ab",
".",
"add",
"(",
"sku",
")",
";",
"ab",
".",
"add",
"(",
"name",
")",
";",
"ab",
".",
"add",
"(",
"category",
")",
";"... | Returns the value of this EcommerceItem as a JsonArray.
@return this as a JsonArray | [
"Returns",
"the",
"value",
"of",
"this",
"EcommerceItem",
"as",
"a",
"JsonArray",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/EcommerceItem.java#L144-L153 |
102,991 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.getCustomTrackingParameter | public List getCustomTrackingParameter(String key){
if (key == null){
throw new NullPointerException("Key cannot be null.");
}
List l = customTrackingParameters.get(key);
if (l == null){
return new ArrayList(0);
}
return new ArrayList(l);
} | java | public List getCustomTrackingParameter(String key){
if (key == null){
throw new NullPointerException("Key cannot be null.");
}
List l = customTrackingParameters.get(key);
if (l == null){
return new ArrayList(0);
}
return new ArrayList(l);
} | [
"public",
"List",
"getCustomTrackingParameter",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Key cannot be null.\"",
")",
";",
"}",
"List",
"l",
"=",
"customTrackingParameters",
".",
... | Gets the list of objects currently stored at the specified custom tracking
parameter. An empty list will be returned if there are no objects set at
that key.
@param key the key of the parameter whose list of objects to get. Cannot be null
@return the list of objects currently stored at the specified key | [
"Gets",
"the",
"list",
"of",
"objects",
"currently",
"stored",
"at",
"the",
"specified",
"custom",
"tracking",
"parameter",
".",
"An",
"empty",
"list",
"will",
"be",
"returned",
"if",
"there",
"are",
"no",
"objects",
"set",
"at",
"that",
"key",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L449-L458 |
102,992 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.addCustomTrackingParameter | public void addCustomTrackingParameter(String key, Object value){
if (key == null){
throw new NullPointerException("Key cannot be null.");
}
if (value == null){
throw new NullPointerException("Cannot add a null custom tracking parameter.");
}
else{
... | java | public void addCustomTrackingParameter(String key, Object value){
if (key == null){
throw new NullPointerException("Key cannot be null.");
}
if (value == null){
throw new NullPointerException("Cannot add a null custom tracking parameter.");
}
else{
... | [
"public",
"void",
"addCustomTrackingParameter",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Key cannot be null.\"",
")",
";",
"}",
"if",
"(",
"value",
"==",... | Add a custom tracking parameter to the specified key. This allows users
to have multiple parameters with the same name and different values,
commonly used during situations where list parameters are needed
@param key the parameter's key. Cannot be null
@param value the parameter's value. Cannot be null | [
"Add",
"a",
"custom",
"tracking",
"parameter",
"to",
"the",
"specified",
"key",
".",
"This",
"allows",
"users",
"to",
"have",
"multiple",
"parameters",
"with",
"the",
"same",
"name",
"and",
"different",
"values",
"commonly",
"used",
"during",
"situations",
"wh... | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L490-L505 |
102,993 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.setGoalRevenue | public void setGoalRevenue(Double goalRevenue){
if (goalRevenue != null && getGoalId() == null){
throw new IllegalStateException("GoalId must be set before GoalRevenue can be set.");
}
setParameter(GOAL_REVENUE, goalRevenue);
} | java | public void setGoalRevenue(Double goalRevenue){
if (goalRevenue != null && getGoalId() == null){
throw new IllegalStateException("GoalId must be set before GoalRevenue can be set.");
}
setParameter(GOAL_REVENUE, goalRevenue);
} | [
"public",
"void",
"setGoalRevenue",
"(",
"Double",
"goalRevenue",
")",
"{",
"if",
"(",
"goalRevenue",
"!=",
"null",
"&&",
"getGoalId",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"GoalId must be set before GoalRevenue can be set... | Set a monetary value that was generated as revenue by this goal conversion.
Only used if idgoal is specified in the request.
@param goalRevenue the goal revenue to set. A null value will remove this parameter | [
"Set",
"a",
"monetary",
"value",
"that",
"was",
"generated",
"as",
"revenue",
"by",
"this",
"goal",
"conversion",
".",
"Only",
"used",
"if",
"idgoal",
"is",
"specified",
"in",
"the",
"request",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L864-L869 |
102,994 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.setPageCustomVariable | @Deprecated
public void setPageCustomVariable(String key, String value){
if (value == null){
removeCustomVariable(PAGE_CUSTOM_VARIABLE, key);
} else {
setCustomVariable(PAGE_CUSTOM_VARIABLE, new CustomVariable(key, value), null);
}
} | java | @Deprecated
public void setPageCustomVariable(String key, String value){
if (value == null){
removeCustomVariable(PAGE_CUSTOM_VARIABLE, key);
} else {
setCustomVariable(PAGE_CUSTOM_VARIABLE, new CustomVariable(key, value), null);
}
} | [
"@",
"Deprecated",
"public",
"void",
"setPageCustomVariable",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"removeCustomVariable",
"(",
"PAGE_CUSTOM_VARIABLE",
",",
"key",
")",
";",
"}",
"else",
"{",
"... | Set a page custom variable with the specified key and value at the first available index.
All page custom variables with this key will be overwritten or deleted
@param key the key of the variable to set
@param value the value of the variable to set at the specified key. A null value will remove this custom variable
@d... | [
"Set",
"a",
"page",
"custom",
"variable",
"with",
"the",
"specified",
"key",
"and",
"value",
"at",
"the",
"first",
"available",
"index",
".",
"All",
"page",
"custom",
"variables",
"with",
"this",
"key",
"will",
"be",
"overwritten",
"or",
"deleted"
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L985-L992 |
102,995 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.setSearchCategory | public void setSearchCategory(String searchCategory){
if (searchCategory != null && getSearchQuery() == null){
throw new IllegalStateException("SearchQuery must be set before SearchCategory can be set.");
}
setParameter(SEARCH_CATEGORY, searchCategory);
} | java | public void setSearchCategory(String searchCategory){
if (searchCategory != null && getSearchQuery() == null){
throw new IllegalStateException("SearchQuery must be set before SearchCategory can be set.");
}
setParameter(SEARCH_CATEGORY, searchCategory);
} | [
"public",
"void",
"setSearchCategory",
"(",
"String",
"searchCategory",
")",
"{",
"if",
"(",
"searchCategory",
"!=",
"null",
"&&",
"getSearchQuery",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"SearchQuery must be set before Sea... | Specify a search category with this parameter. SearchQuery must first be
set.
@param searchCategory the search category to set. A null value will remove this parameter | [
"Specify",
"a",
"search",
"category",
"with",
"this",
"parameter",
".",
"SearchQuery",
"must",
"first",
"be",
"set",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1275-L1280 |
102,996 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.setUserCustomVariable | @Deprecated
public void setUserCustomVariable(String key, String value){
if (value == null){
removeCustomVariable(VISIT_CUSTOM_VARIABLE, key);
} else {
setCustomVariable(VISIT_CUSTOM_VARIABLE, new CustomVariable(key, value), null);
}
} | java | @Deprecated
public void setUserCustomVariable(String key, String value){
if (value == null){
removeCustomVariable(VISIT_CUSTOM_VARIABLE, key);
} else {
setCustomVariable(VISIT_CUSTOM_VARIABLE, new CustomVariable(key, value), null);
}
} | [
"@",
"Deprecated",
"public",
"void",
"setUserCustomVariable",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"removeCustomVariable",
"(",
"VISIT_CUSTOM_VARIABLE",
",",
"key",
")",
";",
"}",
"else",
"{",
... | Set a visit custom variable with the specified key and value at the first available index.
All visit custom variables with this key will be overwritten or deleted
@param key the key of the variable to set
@param value the value of the variable to set at the specified key. A null value will remove this parameter
@depre... | [
"Set",
"a",
"visit",
"custom",
"variable",
"with",
"the",
"specified",
"key",
"and",
"value",
"at",
"the",
"first",
"available",
"index",
".",
"All",
"visit",
"custom",
"variables",
"with",
"this",
"key",
"will",
"be",
"overwritten",
"or",
"deleted"
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1382-L1389 |
102,997 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.getQueryString | public String getQueryString(){
StringBuilder sb = new StringBuilder();
for (Entry<String, Object> parameter : parameters.entrySet()){
if (sb.length() > 0){
sb.append("&");
}
sb.append(parameter.getKey());
sb.append("=");
sb.app... | java | public String getQueryString(){
StringBuilder sb = new StringBuilder();
for (Entry<String, Object> parameter : parameters.entrySet()){
if (sb.length() > 0){
sb.append("&");
}
sb.append(parameter.getKey());
sb.append("=");
sb.app... | [
"public",
"String",
"getQueryString",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"Object",
">",
"parameter",
":",
"parameters",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"... | Get the query string represented by this object.
@return the query string represented by this object | [
"Get",
"the",
"query",
"string",
"represented",
"by",
"this",
"object",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1666-L1688 |
102,998 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.getUrlEncodedQueryString | public String getUrlEncodedQueryString(){
StringBuilder sb = new StringBuilder();
for (Entry<String, Object> parameter : parameters.entrySet()){
if (sb.length() > 0){
sb.append("&");
}
try {
StringBuilder sb2 = new StringBuilder();
... | java | public String getUrlEncodedQueryString(){
StringBuilder sb = new StringBuilder();
for (Entry<String, Object> parameter : parameters.entrySet()){
if (sb.length() > 0){
sb.append("&");
}
try {
StringBuilder sb2 = new StringBuilder();
... | [
"public",
"String",
"getUrlEncodedQueryString",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"Object",
">",
"parameter",
":",
"parameters",
".",
"entrySet",
"(",
")",
")",
"{",
... | Get the url encoded query string represented by this object.
@return the url encoded query string represented by this object | [
"Get",
"the",
"url",
"encoded",
"query",
"string",
"represented",
"by",
"this",
"object",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1694-L1730 |
102,999 | matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.getRandomHexString | public static String getRandomHexString(int length){
byte[] bytes = new byte[length/2];
new Random().nextBytes(bytes);
return DatatypeConverter.printHexBinary(bytes);
} | java | public static String getRandomHexString(int length){
byte[] bytes = new byte[length/2];
new Random().nextBytes(bytes);
return DatatypeConverter.printHexBinary(bytes);
} | [
"public",
"static",
"String",
"getRandomHexString",
"(",
"int",
"length",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"length",
"/",
"2",
"]",
";",
"new",
"Random",
"(",
")",
".",
"nextBytes",
"(",
"bytes",
")",
";",
"return",
"Data... | Get a random hexadecimal string of a specified length.
@param length length of the string to produce
@return a random string consisting only of hexadecimal characters | [
"Get",
"a",
"random",
"hexadecimal",
"string",
"of",
"a",
"specified",
"length",
"."
] | 23df71d27a89e89dc7a539b2eda88c90a206458b | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1737-L1741 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.